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 "/**\n" | 86 "/// Fetches the raw value of a @c $owning_message_class$'s @c $name$ prop
erty, even\n" |
87 " * Fetches the raw value of a @c $owning_message_class$'s @c $name$ prope
rty, even\n" | 87 "/// if the value was not defined by the enum at the time the code was gen
erated.\n" |
88 " * if the value was not defined by the enum at the time the code was gene
rated.\n" | |
89 " **/\n" | |
90 "int32_t $owning_message_class$_$capitalized_name$_RawValue($owning_messag
e_class$ *message);\n" | 88 "int32_t $owning_message_class$_$capitalized_name$_RawValue($owning_messag
e_class$ *message);\n" |
91 "/**\n" | 89 "/// Sets the raw value of an @c $owning_message_class$'s @c $name$ proper
ty, allowing\n" |
92 " * Sets the raw value of an @c $owning_message_class$'s @c $name$ propert
y, allowing\n" | 90 "/// it to be set to a value that was not defined by the enum at the time
the code\n" |
93 " * it to be set to a value that was not defined by the enum at the time t
he code\n" | 91 "/// was generated.\n" |
94 " * was generated.\n" | |
95 " **/\n" | |
96 "void Set$owning_message_class$_$capitalized_name$_RawValue($owning_messag
e_class$ *message, int32_t value);\n" | 92 "void Set$owning_message_class$_$capitalized_name$_RawValue($owning_messag
e_class$ *message, int32_t value);\n" |
97 "\n"); | 93 "\n"); |
98 } | 94 } |
99 | 95 |
100 void EnumFieldGenerator::GenerateCFunctionImplementations( | 96 void EnumFieldGenerator::GenerateCFunctionImplementations( |
101 io::Printer* printer) const { | 97 io::Printer* printer) const { |
102 if (!HasPreservingUnknownEnumSemantics(descriptor_->file())) return; | 98 if (!HasPreservingUnknownEnumSemantics(descriptor_->file())) return; |
103 | 99 |
104 printer->Print( | 100 printer->Print( |
105 variables_, | 101 variables_, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 void RepeatedEnumFieldGenerator::FinishInitialization(void) { | 138 void RepeatedEnumFieldGenerator::FinishInitialization(void) { |
143 RepeatedFieldGenerator::FinishInitialization(); | 139 RepeatedFieldGenerator::FinishInitialization(); |
144 variables_["array_comment"] = | 140 variables_["array_comment"] = |
145 "// |" + variables_["name"] + "| contains |" + variables_["storage_type"]
+ "|\n"; | 141 "// |" + variables_["name"] + "| contains |" + variables_["storage_type"]
+ "|\n"; |
146 } | 142 } |
147 | 143 |
148 } // namespace objectivec | 144 } // namespace objectivec |
149 } // namespace compiler | 145 } // namespace compiler |
150 } // namespace protobuf | 146 } // namespace protobuf |
151 } // namespace google | 147 } // namespace google |
OLD | NEW |