Home
last modified time | relevance | path

Searched refs:enum_decl (Results 1 – 14 of 14) sorted by relevance

/system/tools/aidl/
Daidl_to_cpp_common.cpp248 void GenerateEnumClassDecl(CodeWriter& out, const AidlEnumDeclaration& enum_decl, in GenerateEnumClassDecl() argument
251 GenerateDeprecated(out, enum_decl); in GenerateEnumClassDecl()
252 out << " " << enum_decl.GetName() << " : " << backing_type << " {\n"; in GenerateEnumClassDecl()
254 for (const auto& enumerator : enum_decl.GetEnumerators()) { in GenerateEnumClassDecl()
257 out << " = " << enumerator->ValueString(enum_decl.GetBackingType(), decorator) << ",\n"; in GenerateEnumClassDecl()
263 static bool IsEnumDeprecated(const AidlEnumDeclaration& enum_decl) { in IsEnumDeprecated() argument
264 if (enum_decl.IsDeprecated()) { in IsEnumDeprecated()
267 for (const auto& e : enum_decl.GetEnumerators()) { in IsEnumDeprecated()
277 std::string GenerateEnumValues(const AidlEnumDeclaration& enum_decl, in GenerateEnumValues() argument
280 Join(Append(enclosing_namespaces_of_enum_decl, enum_decl.GetSplitPackage()), "::") + in GenerateEnumValues()
[all …]
Daidl_to_cpp.cpp78 if (auto enum_decl = typenames.GetEnumDeclaration(type); enum_decl != nullptr) { in RawParcelMethod() local
82 return RawParcelMethod(enum_decl->GetBackingType(), typenames, readMethod); in RawParcelMethod()
261 if (auto enum_decl = typenames.GetEnumDeclaration(type); in ParcelReadCastOf() local
262 enum_decl != nullptr && !type.IsArray()) { in ParcelReadCastOf()
264 CppNameOf(enum_decl->GetBackingType(), typenames).c_str(), in ParcelReadCastOf()
277 if (auto enum_decl = typenames.GetEnumDeclaration(type); in ParcelWriteCastOf() local
278 enum_decl != nullptr && !type.IsArray()) { in ParcelWriteCastOf()
280 CppNameOf(enum_decl->GetBackingType(), typenames).c_str(), in ParcelWriteCastOf()
Daidl_checkapi.cpp227 static bool HasZeroEnumerator(const AidlEnumDeclaration& enum_decl) { in HasZeroEnumerator() argument
228 return std::any_of(enum_decl.GetEnumerators().begin(), enum_decl.GetEnumerators().end(), in HasZeroEnumerator()
231 enum_decl.GetBackingType(), AidlConstantValueDecorator) == "0"; in HasZeroEnumerator()
235 static bool EvaluatesToZero(const AidlEnumDeclaration& enum_decl, const AidlConstantValue* value) { in EvaluatesToZero() argument
237 return value->ValueString(enum_decl.GetBackingType(), AidlConstantValueDecorator) == "0"; in EvaluatesToZero()
279 auto enum_decl = new_types.GetEnumDeclaration(new_field->GetType()); in are_compatible_parcelables() local
280 if (old_value == "" && enum_decl && EvaluatesToZero(*enum_decl, new_field->GetDefaultValue())) { in are_compatible_parcelables()
313 if (const auto& enum_decl = new_types.GetEnumDeclaration(new_field->GetType()); in are_compatible_parcelables() local
314 enum_decl != nullptr) { in are_compatible_parcelables()
315 if (HasZeroEnumerator(*enum_decl)) { in are_compatible_parcelables()
[all …]
Daidl_typenames.cpp368 if (auto enum_decl = defined_type->AsEnumDeclaration(); enum_decl != nullptr) { in GetEnumDeclaration() local
369 return enum_decl; in GetEnumDeclaration()
406 if (auto enum_decl = const_cast<AidlDefinedType&>(type).AsEnumDeclaration(); enum_decl) { in Autofill() local
407 if (!enum_decl->Autofill(*this)) { in Autofill()
Dgenerate_ndk.cpp58 const AidlEnumDeclaration& enum_decl, const Options& options);
166 void Visit(const AidlEnumDeclaration& enum_decl) override { in GenerateHeaderDefinitions()
167 const auto backing_type = NdkNameOf(types, enum_decl.GetBackingType(), StorageMode::STACK); in GenerateHeaderDefinitions()
168 EnterNdkNamespace(out, enum_decl); in GenerateHeaderDefinitions()
169 out << cpp::GenerateEnumToString(enum_decl, backing_type); in GenerateHeaderDefinitions()
170 LeaveNdkNamespace(out, enum_decl); in GenerateHeaderDefinitions()
174 out << cpp::GenerateEnumValues(enum_decl, {"aidl"}); in GenerateHeaderDefinitions()
214 } else if (auto enum_decl = AidlCast<AidlEnumDeclaration>(defined_type); enum_decl) { in GenerateClientHeader() local
229 } else if (auto enum_decl = AidlCast<AidlEnumDeclaration>(defined_type); enum_decl) { in GenerateServerHeader() local
261 void Visit(const AidlEnumDeclaration& enum_decl) override { in GenerateSource()
[all …]
Daidl_to_cpp_common.h98 void GenerateEnumClassDecl(CodeWriter& out, const AidlEnumDeclaration& enum_decl,
100 std::string GenerateEnumToString(const AidlEnumDeclaration& enum_decl,
102 std::string GenerateEnumValues(const AidlEnumDeclaration& enum_decl,
Dgenerate_cpp.cpp1332 void GenerateEnumClassDecl(CodeWriter& out, const AidlEnumDeclaration& enum_decl, in GenerateEnumClassDecl() argument
1334 cpp::GenerateEnumClassDecl(out, enum_decl, CppNameOf(enum_decl.GetBackingType(), typenames), in GenerateEnumClassDecl()
1346 } else if (auto enum_decl = AidlCast<AidlEnumDeclaration>(defined_type); enum_decl) { in GenerateClassDecl() local
1347 GenerateEnumClassDecl(out, *enum_decl, typenames); in GenerateClassDecl()
1440 void Visit(const AidlEnumDeclaration& enum_decl) override { in GenerateHeaderDefinitions()
1441 const auto backing_type = CppNameOf(enum_decl.GetBackingType(), typenames); in GenerateHeaderDefinitions()
1442 EnterNamespace(out, enum_decl); in GenerateHeaderDefinitions()
1443 out << GenerateEnumToString(enum_decl, backing_type); in GenerateHeaderDefinitions()
1444 LeaveNamespace(out, enum_decl); in GenerateHeaderDefinitions()
1448 out << GenerateEnumValues(enum_decl, {""}); in GenerateHeaderDefinitions()
[all …]
Dgenerate_java.cpp622 void GenerateEnumClass(CodeWriter& out, const AidlEnumDeclaration& enum_decl) { in GenerateEnumClass() argument
623 const AidlTypeSpecifier& backing_type = enum_decl.GetBackingType(); in GenerateEnumClass()
626 out << GenerateComments(enum_decl); in GenerateEnumClass()
627 out << GenerateAnnotations(enum_decl); in GenerateEnumClass()
629 if (enum_decl.GetParentType()) { in GenerateEnumClass()
632 out << "@interface " << enum_decl.GetName() << " {\n"; in GenerateEnumClass()
634 for (const auto& enumerator : enum_decl.GetEnumerators()) { in GenerateEnumClass()
640 if (enum_decl.JavaDerive("toString")) { in GenerateEnumClass()
645 for (const auto& enumerator : enum_decl.GetEnumerators()) { in GenerateEnumClass()
1050 } else if (const AidlEnumDeclaration* enum_decl = defined_type.AsEnumDeclaration(); in GenerateClass() local
[all …]
Daidl_to_ndk.cpp104 } else if (const AidlEnumDeclaration* enum_decl = type->AsEnumDeclaration(); in GetBaseTypeInfo() local
105 enum_decl != nullptr) { in GetBaseTypeInfo()
106 const std::string clazz = NdkFullClassName(*enum_decl, cpp::ClassNames::RAW); in GetBaseTypeInfo()
Dgenerate_rust.cpp1393 void GenerateRustEnumDeclaration(CodeWriter* code_writer, const AidlEnumDeclaration* enum_decl, in GenerateRustEnumDeclaration() argument
1395 const auto& aidl_backing_type = enum_decl->GetBackingType(); in GenerateRustEnumDeclaration()
1403 GenerateDeprecated(*code_writer, *enum_decl); in GenerateRustEnumDeclaration()
1405 AIDL_FATAL_IF(alignment == std::nullopt, *enum_decl); in GenerateRustEnumDeclaration()
1409 *code_writer << "r#" << enum_decl->GetName() << " : [" << backing_type << "; " in GenerateRustEnumDeclaration()
1410 << std::to_string(enum_decl->GetEnumerators().size()) << "] {\n"; in GenerateRustEnumDeclaration()
1412 for (const auto& enumerator : enum_decl->GetEnumerators()) { in GenerateRustEnumDeclaration()
1429 } else if (const AidlEnumDeclaration* enum_decl = defined_type.AsEnumDeclaration(); in GenerateClass() local
1430 enum_decl != nullptr) { in GenerateClass()
1431 GenerateRustEnumDeclaration(code_writer, enum_decl, types); in GenerateClass()
Daidl_to_java.cpp111 const auto enum_decl = defined_type->AsEnumDeclaration(); in JavaNameOf() local
112 const string& backing_type_name = enum_decl->GetBackingType().GetName(); in JavaNameOf()
113 AIDL_FATAL_IF(m.find(backing_type_name) == m.end(), enum_decl); in JavaNameOf()
114 AIDL_FATAL_IF(!AidlTypenames::IsBuiltinTypename(backing_type_name), enum_decl); in JavaNameOf()
168 const AidlEnumDeclaration* enum_decl = defined_type->AsEnumDeclaration(); in AidlBackingTypeName() local
169 type_name = enum_decl->GetBackingType().GetName(); in AidlBackingTypeName()
Daidl_language_y.yy155 %type<declaration> enum_decl
288 | enum_decl
612 enum_decl
Daidl_const_expressions.cpp952 if (auto enum_decl = defined_type->AsEnumDeclaration(); enum_decl) { in Resolve() local
953 for (const auto& e : enum_decl->GetEnumerators()) { in Resolve()
Daidl.cpp550 AidlEnumDeclaration* enum_decl = defined_type->AsEnumDeclaration(); in load_and_validate_aidl() local
553 !!interface + !!parcelable + !!unstructured_parcelable + !!enum_decl + !!union_decl != 1, in load_and_validate_aidl()