blob: 97b806fc9388352625de5f91ebcf6888c838457d [file] [log] [blame]
Andreas Huber1aec3972016-08-26 09:26:32 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Andreas Huberc9410c72016-07-28 12:18:40 -070017#include "EnumType.h"
18
Andreas Huber019d21d2016-10-03 12:59:47 -070019#include "Annotation.h"
Andreas Huber881227d2016-08-02 14:20:21 -070020#include "ScalarType.h"
Andreas Huberc9410c72016-07-28 12:18:40 -070021
Iliyan Malcheva72e0d22016-09-09 11:03:08 -070022#include <inttypes.h>
23#include <hidl-util/Formatter.h>
Andreas Huber737080b2016-08-02 15:38:04 -070024#include <android-base/logging.h>
25
Andreas Huberc9410c72016-07-28 12:18:40 -070026namespace android {
27
Andreas Huberc9410c72016-07-28 12:18:40 -070028EnumType::EnumType(
Andreas Huber9ed827c2016-08-22 12:31:13 -070029 const char *localName,
Yifan Honga4b53d02016-10-31 17:29:10 -070030 const Location &location,
Andreas Huber9ed827c2016-08-22 12:31:13 -070031 Type *storageType)
Yifan Honga4b53d02016-10-31 17:29:10 -070032 : Scope(localName, location),
Yifan Hongf24fa852016-09-23 11:03:15 -070033 mValues(),
Andreas Huber881227d2016-08-02 14:20:21 -070034 mStorageType(
35 storageType != NULL
36 ? storageType
37 : new ScalarType(ScalarType::KIND_INT32)) {
Andreas Huberc9410c72016-07-28 12:18:40 -070038}
39
Andreas Huber8d3ac0c2016-08-04 14:49:23 -070040const Type *EnumType::storageType() const {
41 return mStorageType;
42}
43
44const std::vector<EnumValue *> &EnumType::values() const {
Yifan Hongf24fa852016-09-23 11:03:15 -070045 return mValues;
46}
47
48void EnumType::addValue(EnumValue *value) {
49 CHECK(value != nullptr);
50
51 EnumValue *prev = nullptr;
52 std::vector<const EnumType *> chain;
53 getTypeChain(&chain);
54 for (auto it = chain.begin(); it != chain.end(); ++it) {
55 const auto &type = *it;
56 if(!type->values().empty()) {
57 prev = type->values().back();
58 break;
59 }
60 }
61
62 value->autofill(prev, resolveToScalarType());
63 mValues.push_back(value);
Andreas Huber8d3ac0c2016-08-04 14:49:23 -070064}
65
Andreas Huber737080b2016-08-02 15:38:04 -070066const ScalarType *EnumType::resolveToScalarType() const {
67 return mStorageType->resolveToScalarType();
68}
69
Andreas Huber8d3ac0c2016-08-04 14:49:23 -070070bool EnumType::isEnum() const {
71 return true;
72}
73
Steven Moreland979e0992016-09-07 09:18:08 -070074std::string EnumType::getCppType(StorageMode,
Steven Moreland979e0992016-09-07 09:18:08 -070075 bool specifyNamespaces) const {
Steven Moreland979e0992016-09-07 09:18:08 -070076 return specifyNamespaces ? fullName() : partialCppName();
Andreas Huber881227d2016-08-02 14:20:21 -070077}
78
Yifan Hong4ed13472016-11-02 10:44:11 -070079std::string EnumType::getJavaType(bool forInitializer) const {
80 return mStorageType->resolveToScalarType()->getJavaType(forInitializer);
Andreas Huber2831d512016-08-15 09:33:47 -070081}
82
83std::string EnumType::getJavaSuffix() const {
84 return mStorageType->resolveToScalarType()->getJavaSuffix();
85}
86
Andreas Hubera3558b32016-09-14 09:12:42 -070087std::string EnumType::getJavaWrapperType() const {
88 return mStorageType->resolveToScalarType()->getJavaWrapperType();
89}
90
Zhuoyao Zhangc5ea9f52016-10-06 15:05:39 -070091std::string EnumType::getVtsType() const {
92 return "TYPE_ENUM";
93}
94
Yifan Hongf24fa852016-09-23 11:03:15 -070095LocalIdentifier *EnumType::lookupIdentifier(const std::string &name) const {
96 std::vector<const EnumType *> chain;
97 getTypeChain(&chain);
98 for (auto it = chain.begin(); it != chain.end(); ++it) {
99 const auto &type = *it;
100 for(EnumValue *v : type->values()) {
101 if(v->name() == name) {
102 return v;
103 }
104 }
105 }
106 return nullptr;
107}
108
Andreas Huber881227d2016-08-02 14:20:21 -0700109void EnumType::emitReaderWriter(
110 Formatter &out,
111 const std::string &name,
112 const std::string &parcelObj,
113 bool parcelObjIsPointer,
114 bool isReader,
115 ErrorMode mode) const {
Andreas Huber737080b2016-08-02 15:38:04 -0700116 const ScalarType *scalarType = mStorageType->resolveToScalarType();
117 CHECK(scalarType != NULL);
118
119 scalarType->emitReaderWriterWithCast(
120 out,
121 name,
122 parcelObj,
123 parcelObjIsPointer,
124 isReader,
125 mode,
126 true /* needsCast */);
Andreas Huber881227d2016-08-02 14:20:21 -0700127}
128
Andreas Huber85eabdb2016-08-25 11:24:49 -0700129void EnumType::emitJavaFieldReaderWriter(
130 Formatter &out,
Andreas Huber4c865b72016-09-14 15:26:27 -0700131 size_t depth,
Andreas Huber709b62d2016-09-19 11:21:18 -0700132 const std::string &parcelName,
Andreas Huber85eabdb2016-08-25 11:24:49 -0700133 const std::string &blobName,
134 const std::string &fieldName,
135 const std::string &offset,
136 bool isReader) const {
137 return mStorageType->emitJavaFieldReaderWriter(
Andreas Huber709b62d2016-09-19 11:21:18 -0700138 out, depth, parcelName, blobName, fieldName, offset, isReader);
Andreas Huber85eabdb2016-08-25 11:24:49 -0700139}
140
Andreas Huber881227d2016-08-02 14:20:21 -0700141status_t EnumType::emitTypeDeclarations(Formatter &out) const {
Andreas Huber737080b2016-08-02 15:38:04 -0700142 const ScalarType *scalarType = mStorageType->resolveToScalarType();
Andreas Hubere3f769a2016-10-10 10:54:44 -0700143 CHECK(scalarType != nullptr);
Andreas Huber737080b2016-08-02 15:38:04 -0700144
Yifan Hong3b320f82016-11-01 15:15:54 -0700145 const std::string storageType = scalarType->getCppStackType();
Andreas Huber881227d2016-08-02 14:20:21 -0700146
147 out << "enum class "
Andreas Huber0e00de42016-08-03 09:56:02 -0700148 << localName()
Andreas Huber881227d2016-08-02 14:20:21 -0700149 << " : "
Andreas Hubere3f769a2016-10-10 10:54:44 -0700150 << storageType
Andreas Huber881227d2016-08-02 14:20:21 -0700151 << " {\n";
152
153 out.indent();
154
Andreas Huber8d3ac0c2016-08-04 14:49:23 -0700155 std::vector<const EnumType *> chain;
Zhuoyao Zhang864c7712016-08-16 15:35:28 -0700156 getTypeChain(&chain);
Andreas Huber8d3ac0c2016-08-04 14:49:23 -0700157
158 for (auto it = chain.rbegin(); it != chain.rend(); ++it) {
159 const auto &type = *it;
160
161 for (const auto &entry : type->values()) {
162 out << entry->name();
163
Yifan Hongfc610cd2016-09-22 13:34:45 -0700164 std::string value = entry->cppValue(scalarType->getKind());
Yifan Hongf24fa852016-09-23 11:03:15 -0700165 CHECK(!value.empty()); // use autofilled values for c++.
166 out << " = " << value;
Andreas Huber8d3ac0c2016-08-04 14:49:23 -0700167
Yifan Hong57886972016-08-17 10:42:15 -0700168 out << ",";
169
Yifan Hongfc610cd2016-09-22 13:34:45 -0700170 std::string comment = entry->comment();
171 if (!comment.empty() && comment != value) {
Yifan Hong57886972016-08-17 10:42:15 -0700172 out << " // " << comment;
173 }
174
175 out << "\n";
Andreas Huber8d3ac0c2016-08-04 14:49:23 -0700176 }
Andreas Huber881227d2016-08-02 14:20:21 -0700177 }
178
179 out.unindent();
180 out << "};\n\n";
181
182 return OK;
183}
184
Jayant Chowdhary2820f8a2016-11-10 12:29:09 -0800185void EnumType::emitEnumBitwiseOperator(
186 Formatter &out,
187 bool mutating,
188 const std::string &op) const {
Andreas Hubere3f769a2016-10-10 10:54:44 -0700189 const ScalarType *scalarType = mStorageType->resolveToScalarType();
190 CHECK(scalarType != nullptr);
191
Yifan Hong3b320f82016-11-01 15:15:54 -0700192 const std::string storageType = scalarType->getCppStackType();
Andreas Hubere3f769a2016-10-10 10:54:44 -0700193
194 out << "inline "
Jayant Chowdhary2820f8a2016-11-10 12:29:09 -0800195 << (mutating ? fullName() : storageType)
Andreas Hubere3f769a2016-10-10 10:54:44 -0700196 << (mutating ? " &" : "")
Jayant Chowdhary2820f8a2016-11-10 12:29:09 -0800197 << " operator"
198 << op
Andreas Hubere3f769a2016-10-10 10:54:44 -0700199 << (mutating ? "=" : "")
200 << "(\n";
201
202 out.indent();
203 out.indent();
204
205 out << fullName()
206 << (mutating ? " &" : " ")
207 << "lhs, "
208 << fullName()
209 << " rhs) {\n";
210 out.unindent();
211
212 if (mutating) {
213 out << "lhs = ";
214 } else {
215 out << "return ";
216 }
217 out << "static_cast<"
Jayant Chowdhary2820f8a2016-11-10 12:29:09 -0800218 << (mutating ? fullName() : storageType)
Andreas Hubere3f769a2016-10-10 10:54:44 -0700219 << ">(\n";
220 out.indent();
221 out.indent();
222 out << "static_cast<"
223 << storageType
Jayant Chowdhary2820f8a2016-11-10 12:29:09 -0800224 << ">(lhs) "
225 << op
226 <<" static_cast<"
Andreas Hubere3f769a2016-10-10 10:54:44 -0700227 << storageType
228 << ">(rhs));\n";
229 out.unindent();
230 out.unindent();
231
232 if (mutating) {
233 out << "return lhs;\n";
234 }
235
236 out.unindent();
237
238 out << "}\n\n";
239}
240
241status_t EnumType::emitGlobalTypeDeclarations(Formatter &out) const {
Jayant Chowdhary2820f8a2016-11-10 12:29:09 -0800242 emitEnumBitwiseOperator(out, false /* mutating */, "|");
243 emitEnumBitwiseOperator(out, true /* mutating */, "|");
244 emitEnumBitwiseOperator(out, false /* mutating */, "&");
245 emitEnumBitwiseOperator(out, true /* mutating */, "&");
Andreas Hubere3f769a2016-10-10 10:54:44 -0700246
247 return OK;
248}
249
Andreas Huber85eabdb2016-08-25 11:24:49 -0700250status_t EnumType::emitJavaTypeDeclarations(Formatter &out, bool) const {
Andreas Huber2831d512016-08-15 09:33:47 -0700251 const ScalarType *scalarType = mStorageType->resolveToScalarType();
252 CHECK(scalarType != NULL);
253
254 out << "public final class "
255 << localName()
256 << " {\n";
257
258 out.indent();
259
Andreas Huber4c865b72016-09-14 15:26:27 -0700260 const std::string typeName =
Yifan Hong4ed13472016-11-02 10:44:11 -0700261 scalarType->getJavaType(false /* forInitializer */);
Andreas Huber2831d512016-08-15 09:33:47 -0700262
263 std::vector<const EnumType *> chain;
Zhuoyao Zhang864c7712016-08-16 15:35:28 -0700264 getTypeChain(&chain);
Andreas Huber2831d512016-08-15 09:33:47 -0700265
266 for (auto it = chain.rbegin(); it != chain.rend(); ++it) {
267 const auto &type = *it;
268
269 for (const auto &entry : type->values()) {
270 out << "public static final "
271 << typeName
272 << " "
Andreas Huberab647c02016-09-14 09:44:00 -0700273 << entry->name()
274 << " = ";
Andreas Huber2831d512016-08-15 09:33:47 -0700275
Yifan Hongf24fa852016-09-23 11:03:15 -0700276 // javaValue will make the number signed.
Yifan Hongfc610cd2016-09-22 13:34:45 -0700277 std::string value = entry->javaValue(scalarType->getKind());
Yifan Hongf24fa852016-09-23 11:03:15 -0700278 CHECK(!value.empty()); // use autofilled values for java.
279 out << value;
Andreas Huber2831d512016-08-15 09:33:47 -0700280
Yifan Hong19ca75a2016-08-31 10:20:03 -0700281 out << ";";
282
Yifan Hongfc610cd2016-09-22 13:34:45 -0700283 std::string comment = entry->comment();
284 if (!comment.empty() && comment != value) {
Yifan Hong19ca75a2016-08-31 10:20:03 -0700285 out << " // " << comment;
286 }
287
288 out << "\n";
Andreas Huber2831d512016-08-15 09:33:47 -0700289 }
290 }
291
292 out.unindent();
293 out << "};\n\n";
294
295 return OK;
296}
297
Zhuoyao Zhang5158db42016-08-10 10:25:20 -0700298status_t EnumType::emitVtsTypeDeclarations(Formatter &out) const {
Yifan Hongc07b2022016-11-08 12:44:24 -0800299 const ScalarType *scalarType = mStorageType->resolveToScalarType();
300
Zhuoyao Zhangbf828c82016-10-26 14:15:10 -0700301 out << "name: \"" << fullName() << "\"\n";
Zhuoyao Zhangc5ea9f52016-10-06 15:05:39 -0700302 out << "type: " << getVtsType() << "\n";
303 out << "enum_value: {\n";
Zhuoyao Zhang5158db42016-08-10 10:25:20 -0700304 out.indent();
Zhuoyao Zhang864c7712016-08-16 15:35:28 -0700305
Zhuoyao Zhangc5ea9f52016-10-06 15:05:39 -0700306 out << "scalar_type: \""
Yifan Hongc07b2022016-11-08 12:44:24 -0800307 << scalarType->getVtsScalarType()
Zhuoyao Zhangc5ea9f52016-10-06 15:05:39 -0700308 << "\"\n\n";
Zhuoyao Zhang864c7712016-08-16 15:35:28 -0700309 std::vector<const EnumType *> chain;
310 getTypeChain(&chain);
311
312 for (auto it = chain.rbegin(); it != chain.rend(); ++it) {
313 const auto &type = *it;
314
315 for (const auto &entry : type->values()) {
316 out << "enumerator: \"" << entry->name() << "\"\n";
Zhuoyao Zhangc5ea9f52016-10-06 15:05:39 -0700317 out << "scalar_value: {\n";
318 out.indent();
Yifan Hongc07b2022016-11-08 12:44:24 -0800319 // use autofilled values for vts.
320 std::string value = entry->value(scalarType->getKind());
321 CHECK(!value.empty());
322 out << mStorageType->resolveToScalarType()->getVtsScalarType()
323 << ": "
324 << value
325 << "\n";
Zhuoyao Zhangc5ea9f52016-10-06 15:05:39 -0700326 out.unindent();
327 out << "}\n";
Zhuoyao Zhang864c7712016-08-16 15:35:28 -0700328 }
Zhuoyao Zhang5158db42016-08-10 10:25:20 -0700329 }
Zhuoyao Zhang864c7712016-08-16 15:35:28 -0700330
Zhuoyao Zhang5158db42016-08-10 10:25:20 -0700331 out.unindent();
332 out << "}\n";
333 return OK;
334}
335
Zhuoyao Zhang864c7712016-08-16 15:35:28 -0700336status_t EnumType::emitVtsAttributeType(Formatter &out) const {
Zhuoyao Zhangc5ea9f52016-10-06 15:05:39 -0700337 out << "type: " << getVtsType() << "\n";
Zhuoyao Zhangbf828c82016-10-26 14:15:10 -0700338 out << "predefined_type: \"" << fullName() << "\"\n";
Zhuoyao Zhang5158db42016-08-10 10:25:20 -0700339 return OK;
340}
341
Zhuoyao Zhang864c7712016-08-16 15:35:28 -0700342void EnumType::getTypeChain(std::vector<const EnumType *> *out) const {
343 out->clear();
344 const EnumType *type = this;
345 for (;;) {
346 out->push_back(type);
347
348 const Type *superType = type->storageType();
349 if (superType == NULL || !superType->isEnum()) {
350 break;
351 }
352
353 type = static_cast<const EnumType *>(superType);
354 }
355}
356
Andreas Huber85eabdb2016-08-25 11:24:49 -0700357void EnumType::getAlignmentAndSize(size_t *align, size_t *size) const {
358 mStorageType->getAlignmentAndSize(align, size);
359}
360
Andreas Huber019d21d2016-10-03 12:59:47 -0700361const Annotation *EnumType::findExportAnnotation() const {
362 for (const auto &annotation : annotations()) {
363 if (annotation->name() == "export") {
364 return annotation;
365 }
366 }
367
368 return nullptr;
369}
370
371void EnumType::appendToExportedTypesVector(
372 std::vector<const Type *> *exportedTypes) const {
373 if (findExportAnnotation() != nullptr) {
374 exportedTypes->push_back(this);
375 }
376}
377
Andreas Huber1c507272016-10-05 14:33:21 -0700378status_t EnumType::emitExportedHeader(Formatter &out, bool forJava) const {
Andreas Huber019d21d2016-10-03 12:59:47 -0700379 const Annotation *annotation = findExportAnnotation();
380 CHECK(annotation != nullptr);
381
382 std::string name = localName();
383
384 const AnnotationParam *nameParam = annotation->getParam("name");
385 if (nameParam != nullptr) {
386 CHECK_EQ(nameParam->getValues()->size(), 1u);
387
388 std::string quotedString = nameParam->getValues()->at(0);
389 name = quotedString.substr(1, quotedString.size() - 2);
390 }
391
Andreas Huberb0627fb2016-10-10 09:39:28 -0700392 std::string valuePrefix;
393
394 const AnnotationParam *prefixParam = annotation->getParam("value_prefix");
395 if (prefixParam != nullptr) {
396 CHECK_EQ(prefixParam->getValues()->size(), 1u);
397
398 std::string quotedString = prefixParam->getValues()->at(0);
399 valuePrefix = quotedString.substr(1, quotedString.size() - 2);
400 }
401
Andreas Huber019d21d2016-10-03 12:59:47 -0700402 const ScalarType *scalarType = mStorageType->resolveToScalarType();
Andreas Huber1c507272016-10-05 14:33:21 -0700403 CHECK(scalarType != nullptr);
Andreas Huber019d21d2016-10-03 12:59:47 -0700404
Andreas Huber1c507272016-10-05 14:33:21 -0700405 if (forJava) {
406 if (!name.empty()) {
407 out << "public final class "
408 << name
409 << " {\n";
410
411 out.indent();
412 } else {
413 out << "// Values declared in " << localName() << " follow.\n";
414 }
415
Andreas Huber1c507272016-10-05 14:33:21 -0700416 const std::string typeName =
Yifan Hong4ed13472016-11-02 10:44:11 -0700417 scalarType->getJavaType(false /* forInitializer */);
Andreas Huber1c507272016-10-05 14:33:21 -0700418
419 std::vector<const EnumType *> chain;
420 getTypeChain(&chain);
421
422 for (auto it = chain.rbegin(); it != chain.rend(); ++it) {
423 const auto &type = *it;
424
425 for (const auto &entry : type->values()) {
426 out << "public static final "
427 << typeName
428 << " "
429 << valuePrefix
430 << entry->name()
431 << " = ";
432
433 // javaValue will make the number signed.
434 std::string value = entry->javaValue(scalarType->getKind());
435 CHECK(!value.empty()); // use autofilled values for java.
436 out << value;
437
438 out << ";";
439
440 std::string comment = entry->comment();
441 if (!comment.empty() && comment != value) {
442 out << " // " << comment;
443 }
444
445 out << "\n";
446 }
447 }
448
449 if (!name.empty()) {
450 out.unindent();
451 out << "};\n";
452 }
453 out << "\n";
454
455 return OK;
456 }
Andreas Huber019d21d2016-10-03 12:59:47 -0700457
458 if (!name.empty()) {
459 out << "typedef ";
460 }
461
462 out << "enum {\n";
463
464 out.indent();
465
466 std::vector<const EnumType *> chain;
467 getTypeChain(&chain);
468
469 for (auto it = chain.rbegin(); it != chain.rend(); ++it) {
470 const auto &type = *it;
471
472 for (const auto &entry : type->values()) {
Andreas Huberb0627fb2016-10-10 09:39:28 -0700473 out << valuePrefix << entry->name();
Andreas Huber019d21d2016-10-03 12:59:47 -0700474
475 std::string value = entry->cppValue(scalarType->getKind());
476 CHECK(!value.empty()); // use autofilled values for c++.
477 out << " = " << value;
478
479 out << ",";
480
481 std::string comment = entry->comment();
482 if (!comment.empty() && comment != value) {
483 out << " // " << comment;
484 }
485
486 out << "\n";
487 }
488 }
489
490 out.unindent();
491 out << "}";
492
493 if (!name.empty()) {
494 out << " " << name;
495 }
496
497 out << ";\n\n";
498
499 return OK;
500}
501
Andreas Huber31629bc2016-08-03 09:06:40 -0700502////////////////////////////////////////////////////////////////////////////////
503
Yifan Hongf24fa852016-09-23 11:03:15 -0700504EnumValue::EnumValue(const char *name, ConstantExpression *value)
Andreas Huber31629bc2016-08-03 09:06:40 -0700505 : mName(name),
Yifan Hongf24fa852016-09-23 11:03:15 -0700506 mValue(value),
507 mIsAutoFill(false) {
Andreas Huber31629bc2016-08-03 09:06:40 -0700508}
509
510std::string EnumValue::name() const {
511 return mName;
512}
513
Yifan Hongc07b2022016-11-08 12:44:24 -0800514std::string EnumValue::value(ScalarType::Kind castKind) const {
Yifan Hongf24fa852016-09-23 11:03:15 -0700515 CHECK(mValue != nullptr);
Yifan Hongc07b2022016-11-08 12:44:24 -0800516 return mValue->value(castKind);
Yifan Hong57886972016-08-17 10:42:15 -0700517}
518
Yifan Hongfc610cd2016-09-22 13:34:45 -0700519std::string EnumValue::cppValue(ScalarType::Kind castKind) const {
Yifan Hongf24fa852016-09-23 11:03:15 -0700520 CHECK(mValue != nullptr);
521 return mValue->cppValue(castKind);
Yifan Hong57886972016-08-17 10:42:15 -0700522}
Yifan Hongfc610cd2016-09-22 13:34:45 -0700523std::string EnumValue::javaValue(ScalarType::Kind castKind) const {
Yifan Hongf24fa852016-09-23 11:03:15 -0700524 CHECK(mValue != nullptr);
525 return mValue->javaValue(castKind);
Yifan Hong19ca75a2016-08-31 10:20:03 -0700526}
Yifan Hong57886972016-08-17 10:42:15 -0700527
Yifan Hongfc610cd2016-09-22 13:34:45 -0700528std::string EnumValue::comment() const {
Yifan Hongf24fa852016-09-23 11:03:15 -0700529 CHECK(mValue != nullptr);
530 return mValue->description();
531}
532
533ConstantExpression *EnumValue::constExpr() const {
534 CHECK(mValue != nullptr);
535 return mValue;
536}
537
538void EnumValue::autofill(const EnumValue *prev, const ScalarType *type) {
539 if(mValue != nullptr)
540 return;
541 mIsAutoFill = true;
542 ConstantExpression *value = new ConstantExpression();
543 if(prev == nullptr) {
544 *value = ConstantExpression::Zero(type->getKind());
545 } else {
546 CHECK(prev->mValue != nullptr);
547 *value = prev->mValue->addOne();
548 }
549 mValue = value;
550}
551
552bool EnumValue::isAutoFill() const {
553 return mIsAutoFill;
554}
555
556bool EnumValue::isEnumValue() const {
557 return true;
Andreas Huber31629bc2016-08-03 09:06:40 -0700558}
559
Andreas Huberc9410c72016-07-28 12:18:40 -0700560} // namespace android
561