summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceParser.h
diff options
context:
space:
mode:
author Ryan Mitchell <rtmitchell@google.com> 2021-07-14 12:53:01 -0700
committer Ryan Mitchell <rtmitchell@google.com> 2021-07-15 13:42:13 -0700
commit4382e44c42d2a1edf92a9ef11dbf34843025e64f (patch)
treef4b2855b1df909e526a298300ee55f79a65ccc79 /tools/aapt2/ResourceParser.h
parent3947c9b56c2e79d76b6941fb5bdcdf25e359b0a4 (diff)
Replace Maybe with std::optional
With c++17, std::optional provides the functionality that Maybe provided. Bug: 183215655 Test: aapt2_tests Change-Id: I62bb9c2fa4985dc5217a6ed153df92b85ad9a034
Diffstat (limited to 'tools/aapt2/ResourceParser.h')
-rw-r--r--tools/aapt2/ResourceParser.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/aapt2/ResourceParser.h b/tools/aapt2/ResourceParser.h
index 261499781638..548f5f9531fd 100644
--- a/tools/aapt2/ResourceParser.h
+++ b/tools/aapt2/ResourceParser.h
@@ -18,6 +18,7 @@
#define AAPT_RESOURCE_PARSER_H
#include <memory>
+#include <optional>
#include "android-base/macros.h"
#include "androidfw/ConfigDescription.h"
@@ -27,7 +28,6 @@
#include "ResourceTable.h"
#include "ResourceValues.h"
#include "StringPool.h"
-#include "util/Maybe.h"
#include "xml/XmlPullParser.h"
namespace aapt {
@@ -54,7 +54,7 @@ struct ResourceParserOptions {
// If visibility was forced, we need to use it when creating a new resource and also error if we
// try to parse the <public>, <public-group>, <java-symbol> or <symbol> tags.
- Maybe<Visibility::Level> visibility;
+ std::optional<Visibility::Level> visibility;
};
struct FlattenedXmlSubTree {
@@ -122,8 +122,8 @@ class ResourceParser {
bool ParseAddResource(xml::XmlPullParser* parser, ParsedResource* out_resource);
bool ParseAttr(xml::XmlPullParser* parser, ParsedResource* out_resource);
bool ParseAttrImpl(xml::XmlPullParser* parser, ParsedResource* out_resource, bool weak);
- Maybe<Attribute::Symbol> ParseEnumOrFlagItem(xml::XmlPullParser* parser,
- const android::StringPiece& tag);
+ std::optional<Attribute::Symbol> ParseEnumOrFlagItem(xml::XmlPullParser* parser,
+ const android::StringPiece& tag);
bool ParseStyle(ResourceType type, xml::XmlPullParser* parser, ParsedResource* out_resource);
bool ParseStyleItem(xml::XmlPullParser* parser, Style* style);
bool ParseDeclareStyleable(xml::XmlPullParser* parser, ParsedResource* out_resource);