summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceValues.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt2/ResourceValues.h')
-rw-r--r--tools/aapt2/ResourceValues.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/aapt2/ResourceValues.h b/tools/aapt2/ResourceValues.h
index 5192c2be1f98..a1b1839b19ef 100644
--- a/tools/aapt2/ResourceValues.h
+++ b/tools/aapt2/ResourceValues.h
@@ -65,6 +65,14 @@ class Value {
return translatable_;
}
+ void SetFlagStatus(FlagStatus val) {
+ flag_status_ = val;
+ }
+
+ FlagStatus GetFlagStatus() const {
+ return flag_status_;
+ }
+
// Returns the source where this value was defined.
const android::Source& GetSource() const {
return source_;
@@ -109,6 +117,10 @@ class Value {
// of brevity and readability. Default implementation just calls Print().
virtual void PrettyPrint(text::Printer* printer) const;
+ // Removes any part of the value that is beind a disabled flag.
+ virtual void RemoveFlagDisabledElements() {
+ }
+
friend std::ostream& operator<<(std::ostream& out, const Value& value);
protected:
@@ -116,6 +128,7 @@ class Value {
std::string comment_;
bool weak_ = false;
bool translatable_ = true;
+ FlagStatus flag_status_ = FlagStatus::NoFlag;
private:
virtual Value* TransformValueImpl(ValueTransformer& transformer) const = 0;
@@ -346,6 +359,7 @@ struct Array : public TransformableValue<Array, BaseValue<Array>> {
bool Equals(const Value* value) const override;
void Print(std::ostream* out) const override;
+ void RemoveFlagDisabledElements() override;
};
struct Plural : public TransformableValue<Plural, BaseValue<Plural>> {