OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 EnumFieldGenerator::~EnumFieldGenerator() {} | 76 EnumFieldGenerator::~EnumFieldGenerator() {} |
77 | 77 |
78 void EnumFieldGenerator::GenerateCFunctionDeclarations( | 78 void EnumFieldGenerator::GenerateCFunctionDeclarations( |
79 io::Printer* printer) const { | 79 io::Printer* printer) const { |
80 if (!HasPreservingUnknownEnumSemantics(descriptor_->file())) { | 80 if (!HasPreservingUnknownEnumSemantics(descriptor_->file())) { |
81 return; | 81 return; |
82 } | 82 } |
83 | 83 |
84 printer->Print( | 84 printer->Print( |
85 variables_, | 85 variables_, |
86 "/// Fetches the raw value of a @c $owning_message_class$'s @c $name$ prop
erty, even\n" | 86 "/**\n" |
87 "/// if the value was not defined by the enum at the time the code was gen
erated.\n" | 87 " * Fetches the raw value of a @c $owning_message_class$'s @c $name$ prope
rty, even\n" |
| 88 " * if the value was not defined by the enum at the time the code was gene
rated.\n" |
| 89 " **/\n" |
88 "int32_t $owning_message_class$_$capitalized_name$_RawValue($owning_messag
e_class$ *message);\n" | 90 "int32_t $owning_message_class$_$capitalized_name$_RawValue($owning_messag
e_class$ *message);\n" |
89 "/// Sets the raw value of an @c $owning_message_class$'s @c $name$ proper
ty, allowing\n" | 91 "/**\n" |
90 "/// it to be set to a value that was not defined by the enum at the time
the code\n" | 92 " * Sets the raw value of an @c $owning_message_class$'s @c $name$ propert
y, allowing\n" |
91 "/// was generated.\n" | 93 " * it to be set to a value that was not defined by the enum at the time t
he code\n" |
| 94 " * was generated.\n" |
| 95 " **/\n" |
92 "void Set$owning_message_class$_$capitalized_name$_RawValue($owning_messag
e_class$ *message, int32_t value);\n" | 96 "void Set$owning_message_class$_$capitalized_name$_RawValue($owning_messag
e_class$ *message, int32_t value);\n" |
93 "\n"); | 97 "\n"); |
94 } | 98 } |
95 | 99 |
96 void EnumFieldGenerator::GenerateCFunctionImplementations( | 100 void EnumFieldGenerator::GenerateCFunctionImplementations( |
97 io::Printer* printer) const { | 101 io::Printer* printer) const { |
98 if (!HasPreservingUnknownEnumSemantics(descriptor_->file())) return; | 102 if (!HasPreservingUnknownEnumSemantics(descriptor_->file())) return; |
99 | 103 |
100 printer->Print( | 104 printer->Print( |
101 variables_, | 105 variables_, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 void RepeatedEnumFieldGenerator::FinishInitialization(void) { | 142 void RepeatedEnumFieldGenerator::FinishInitialization(void) { |
139 RepeatedFieldGenerator::FinishInitialization(); | 143 RepeatedFieldGenerator::FinishInitialization(); |
140 variables_["array_comment"] = | 144 variables_["array_comment"] = |
141 "// |" + variables_["name"] + "| contains |" + variables_["storage_type"]
+ "|\n"; | 145 "// |" + variables_["name"] + "| contains |" + variables_["storage_type"]
+ "|\n"; |
142 } | 146 } |
143 | 147 |
144 } // namespace objectivec | 148 } // namespace objectivec |
145 } // namespace compiler | 149 } // namespace compiler |
146 } // namespace protobuf | 150 } // namespace protobuf |
147 } // namespace google | 151 } // namespace google |
OLD | NEW |