unittest_mset.proto 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // Protocol Buffers - Google's data interchange format
  2. // Copyright 2008 Google Inc. All rights reserved.
  3. //
  4. // Use of this source code is governed by a BSD-style
  5. // license that can be found in the LICENSE file or at
  6. // https://developers.google.com/open-source/licenses/bsd
  7. // Author: kenton@google.com (Kenton Varda)
  8. // Based on original Protocol Buffers design by
  9. // Sanjay Ghemawat, Jeff Dean, and others.
  10. //
  11. // This file is similar to unittest_mset_wire_format.proto, but does not
  12. // have a TestMessageSet, so it can be downgraded to proto1.
  13. syntax = "proto2";
  14. import "google/protobuf/unittest_mset_wire_format.proto";
  15. package protobuf_unittest;
  16. option cc_enable_arenas = true;
  17. option optimize_for = SPEED;
  18. message TestMessageSetContainer {
  19. optional proto2_wireformat_unittest.TestMessageSet message_set = 1;
  20. }
  21. message NestedTestMessageSetContainer {
  22. optional TestMessageSetContainer container = 1;
  23. optional NestedTestMessageSetContainer child = 2;
  24. optional NestedTestMessageSetContainer lazy_child = 3 [lazy = true];
  25. }
  26. message NestedTestInt {
  27. optional fixed32 a = 1;
  28. optional int32 b = 3;
  29. optional NestedTestInt child = 2;
  30. }
  31. message TestMessageSetExtension1 {
  32. extend proto2_wireformat_unittest.TestMessageSet {
  33. optional TestMessageSetExtension1 message_set_extension = 1545008;
  34. }
  35. optional int32 i = 15;
  36. optional proto2_wireformat_unittest.TestMessageSet recursive = 16;
  37. optional string test_aliasing = 17 [ctype = STRING_PIECE];
  38. }
  39. message TestMessageSetExtension2 {
  40. extend proto2_wireformat_unittest.TestMessageSet {
  41. optional TestMessageSetExtension2 message_set_extension = 1547769;
  42. }
  43. optional string str = 25;
  44. }
  45. message TestMessageSetExtension3 {
  46. extend proto2_wireformat_unittest.TestMessageSet {
  47. optional TestMessageSetExtension3 message_set_extension = 195273129;
  48. }
  49. optional NestedTestInt msg = 35;
  50. required int32 required_int = 36;
  51. }
  52. // This message was used to generate
  53. // //net/proto2/python/internal/testdata/message_set_message, but is commented
  54. // out since it must not actually exist in code, to simulate an "unknown"
  55. // extension.
  56. // message TestMessageSetUnknownExtension {
  57. // extend TestMessageSet {
  58. // optional TestMessageSetUnknownExtension message_set_extension = 56141421;
  59. // }
  60. // optional int64 a = 1;
  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. }