diff options
Diffstat (limited to 'tools/aapt2/ResourceUtils.h')
-rw-r--r-- | tools/aapt2/ResourceUtils.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tools/aapt2/ResourceUtils.h b/tools/aapt2/ResourceUtils.h index be493db8cee0..fe450a834dfa 100644 --- a/tools/aapt2/ResourceUtils.h +++ b/tools/aapt2/ResourceUtils.h @@ -75,35 +75,33 @@ bool IsAttributeReference(const android::StringPiece& str); /** * Convert an android::ResTable::resource_name to an aapt::ResourceName struct. */ -Maybe<ResourceName> ToResourceName( - const android::ResTable::resource_name& name); +std::optional<ResourceName> ToResourceName(const android::ResTable::resource_name& name); /** * Convert an android::AssetManager2::ResourceName to an aapt::ResourceName struct. */ -Maybe<ResourceName> ToResourceName( - const android::AssetManager2::ResourceName& name_in); +std::optional<ResourceName> ToResourceName(const android::AssetManager2::ResourceName& name_in); /** * Returns a boolean value if the string is equal to TRUE, true, True, FALSE, * false, or False. */ -Maybe<bool> ParseBool(const android::StringPiece& str); +std::optional<bool> ParseBool(const android::StringPiece& str); /** * Returns a uint32_t if the string is an integer. */ -Maybe<uint32_t> ParseInt(const android::StringPiece& str); +std::optional<uint32_t> ParseInt(const android::StringPiece& str); /** * Returns an ID if it the string represented a valid ID. */ -Maybe<ResourceId> ParseResourceId(const android::StringPiece& str); +std::optional<ResourceId> ParseResourceId(const android::StringPiece& str); /** * Parses an SDK version, which can be an integer, or a letter from A-Z. */ -Maybe<int> ParseSdkVersion(const android::StringPiece& str); +std::optional<int> ParseSdkVersion(const android::StringPiece& str); /* * Returns a Reference, or None Maybe instance if the string `str` was parsed as @@ -116,7 +114,8 @@ Maybe<int> ParseSdkVersion(const android::StringPiece& str); * ?[package:]style/<entry> or * <package>:[style/]<entry> */ -Maybe<Reference> ParseStyleParentReference(const android::StringPiece& str, std::string* out_error); +std::optional<Reference> ParseStyleParentReference(const android::StringPiece& str, + std::string* out_error); /* * Returns a Reference if the string `str` was parsed as a valid XML attribute @@ -125,7 +124,7 @@ Maybe<Reference> ParseStyleParentReference(const android::StringPiece& str, std: * * package:entry */ -Maybe<Reference> ParseXmlAttributeName(const android::StringPiece& str); +std::optional<Reference> ParseXmlAttributeName(const android::StringPiece& str); /* * Returns a Reference object if the string was parsed as a resource or |