diff options
| author | 2024-12-13 17:29:18 -0800 | |
|---|---|---|
| committer | 2024-12-13 17:29:18 -0800 | |
| commit | 7b1f850c50427ff38c20c83721c2e7aa173e62c2 (patch) | |
| tree | 92f02a12a16318cde6d9a3b3761ca2c0040ce557 /tools/aapt2/ResourceValues.h | |
| parent | 3f4c4881a31f0a24979df539b9d1e9c557a3619d (diff) | |
| parent | 10e260fc86f8b879e9a88610994344f30bea7520 (diff) | |
Merge "Merge 24Q4 into AOSP main" into main
Diffstat (limited to 'tools/aapt2/ResourceValues.h')
| -rw-r--r-- | tools/aapt2/ResourceValues.h | 14 |
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>> { |