unittest_mset.proto 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Additional options required for C# generation. File from copyright
  2. // line onwards is as per original distribution.
  3. import "google/protobuf/csharp_options.proto";
  4. option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos";
  5. option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestMessageSetProtoFile";
  6. // Protocol Buffers - Google's data interchange format
  7. // Copyright 2008 Google Inc. All rights reserved.
  8. // http://code.google.com/p/protobuf/
  9. //
  10. // Redistribution and use in source and binary forms, with or without
  11. // modification, are permitted provided that the following conditions are
  12. // met:
  13. //
  14. // * Redistributions of source code must retain the above copyright
  15. // notice, this list of conditions and the following disclaimer.
  16. // * Redistributions in binary form must reproduce the above
  17. // copyright notice, this list of conditions and the following disclaimer
  18. // in the documentation and/or other materials provided with the
  19. // distribution.
  20. // * Neither the name of Google Inc. nor the names of its
  21. // contributors may be used to endorse or promote products derived from
  22. // this software without specific prior written permission.
  23. //
  24. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  25. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  26. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  27. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  28. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  29. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  30. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  31. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  32. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  33. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  34. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. // Author: kenton@google.com (Kenton Varda)
  36. // Based on original Protocol Buffers design by
  37. // Sanjay Ghemawat, Jeff Dean, and others.
  38. //
  39. // This file contains messages for testing message_set_wire_format.
  40. package protobuf_unittest;
  41. option optimize_for = SPEED;
  42. // A message with message_set_wire_format.
  43. message TestMessageSet {
  44. option message_set_wire_format = true;
  45. extensions 4 to max;
  46. }
  47. message TestMessageSetContainer {
  48. optional TestMessageSet message_set = 1;
  49. }
  50. message TestMessageSetExtension1 {
  51. extend TestMessageSet {
  52. optional TestMessageSetExtension1 message_set_extension = 1545008;
  53. }
  54. optional int32 i = 15;
  55. }
  56. message TestMessageSetExtension2 {
  57. extend TestMessageSet {
  58. optional TestMessageSetExtension2 message_set_extension = 1547769;
  59. }
  60. optional string str = 25;
  61. }
  62. // MessageSet wire format is equivalent to this.
  63. message RawMessageSet {
  64. repeated group Item = 1 {
  65. required int32 type_id = 2;
  66. required bytes message = 3;
  67. }
  68. }