/thirdparty/breakpad/third_party/protobuf/protobuf/src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto

http://github.com/tomahawk-player/tomahawk · Protocol Buffers · 113 lines · 53 code · 17 blank · 43 comment · 0 complexity · 86d39c3bd9818e72a0dfeb93242f57ad MD5 · raw file

  1. // Protocol Buffers - Google's data interchange format
  2. // Copyright 2008 Google Inc. All rights reserved.
  3. // http://code.google.com/p/protobuf/
  4. //
  5. // Redistribution and use in source and binary forms, with or without
  6. // modification, are permitted provided that the following conditions are
  7. // met:
  8. //
  9. // * Redistributions of source code must retain the above copyright
  10. // notice, this list of conditions and the following disclaimer.
  11. // * Redistributions in binary form must reproduce the above
  12. // copyright notice, this list of conditions and the following disclaimer
  13. // in the documentation and/or other materials provided with the
  14. // distribution.
  15. // * Neither the name of Google Inc. nor the names of its
  16. // contributors may be used to endorse or promote products derived from
  17. // this software without specific prior written permission.
  18. //
  19. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  22. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  23. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  24. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  25. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  26. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  27. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  28. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. // Author: kenton@google.com (Kenton Varda)
  31. // Based on original Protocol Buffers design by
  32. // Sanjay Ghemawat, Jeff Dean, and others.
  33. //
  34. // This file tests that various identifiers work as field and type names even
  35. // though the same identifiers are used internally by the C++ code generator.
  36. // Some generic_services option(s) added automatically.
  37. // See: http://go/proto2-generic-services-default
  38. option cc_generic_services = true; // auto-added
  39. // We don't put this in a package within proto2 because we need to make sure
  40. // that the generated code doesn't depend on being in the proto2 namespace.
  41. package protobuf_unittest;
  42. // Test that fields can have names like "input" and "i" which are also used
  43. // internally by the code generator for local variables.
  44. message TestConflictingSymbolNames {
  45. message BuildDescriptors {}
  46. message TypeTraits {}
  47. optional int32 input = 1;
  48. optional int32 output = 2;
  49. optional string length = 3;
  50. repeated int32 i = 4;
  51. repeated string new_element = 5 [ctype=STRING_PIECE];
  52. optional int32 total_size = 6;
  53. optional int32 tag = 7;
  54. enum TestEnum { FOO = 1; }
  55. message Data1 { repeated int32 data = 1; }
  56. message Data2 { repeated TestEnum data = 1; }
  57. message Data3 { repeated string data = 1; }
  58. message Data4 { repeated Data4 data = 1; }
  59. message Data5 { repeated string data = 1 [ctype=STRING_PIECE]; }
  60. message Data6 { repeated string data = 1 [ctype=CORD]; }
  61. optional int32 source = 8;
  62. optional int32 value = 9;
  63. optional int32 file = 10;
  64. optional int32 from = 11;
  65. optional int32 handle_uninterpreted = 12;
  66. repeated int32 index = 13;
  67. optional int32 controller = 14;
  68. optional int32 already_here = 15;
  69. optional uint32 uint32 = 16;
  70. optional uint64 uint64 = 17;
  71. optional string string = 18;
  72. optional int32 memset = 19;
  73. optional int32 int32 = 20;
  74. optional int64 int64 = 21;
  75. optional uint32 cached_size = 22;
  76. optional uint32 extensions = 23;
  77. optional uint32 bit = 24;
  78. optional uint32 bits = 25;
  79. optional uint32 offsets = 26;
  80. optional uint32 reflection = 27;
  81. message Cord {}
  82. optional string some_cord = 28 [ctype=CORD];
  83. message StringPiece {}
  84. optional string some_string_piece = 29 [ctype=STRING_PIECE];
  85. // Some keywords.
  86. optional uint32 int = 30;
  87. optional uint32 friend = 31;
  88. // The generator used to #define a macro called "DO" inside the .cc file.
  89. message DO {}
  90. optional DO do = 32;
  91. extensions 1000 to max;
  92. }
  93. message DummyMessage {}
  94. service TestConflictingMethodNames {
  95. rpc Closure(DummyMessage) returns (DummyMessage);
  96. }