Dianne Hackborn | e6b6803 | 2011-10-13 16:26:02 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright 2011 The Android Open Source Project |
| 3 | // |
| 4 | // Build resource files from raw assets. |
| 5 | // |
| 6 | |
| 7 | #ifndef RESOURCE_FILTER_H |
| 8 | #define RESOURCE_FILTER_H |
| 9 | |
| 10 | #include "AaptAssets.h" |
| 11 | |
| 12 | /** |
| 13 | * Implements logic for parsing and handling "-c" and "--preferred-configurations" |
| 14 | * options. |
| 15 | */ |
| 16 | class ResourceFilter |
| 17 | { |
| 18 | public: |
Anton Krumin | a2ef5c0 | 2014-03-12 14:46:44 -0700 | [diff] [blame^] | 19 | ResourceFilter() : mData(), mContainsPseudoAccented(false), |
| 20 | mContainsPseudoBidi(false) {} |
Dianne Hackborn | e6b6803 | 2011-10-13 16:26:02 -0700 | [diff] [blame] | 21 | status_t parse(const char* arg); |
| 22 | bool isEmpty() const; |
Dianne Hackborn | e6b6803 | 2011-10-13 16:26:02 -0700 | [diff] [blame] | 23 | bool match(int axis, const ResTable_config& config) const; |
| 24 | bool match(const ResTable_config& config) const; |
Narayan Kamath | 788fa41 | 2014-01-21 15:32:36 +0000 | [diff] [blame] | 25 | const SortedVector<AxisValue>* configsForAxis(int axis) const; |
Anton Krumin | a2ef5c0 | 2014-03-12 14:46:44 -0700 | [diff] [blame^] | 26 | inline bool containsPseudo() const { return mContainsPseudoAccented; } |
| 27 | inline bool containsPseudoBidi() const { return mContainsPseudoBidi; } |
Dianne Hackborn | e6b6803 | 2011-10-13 16:26:02 -0700 | [diff] [blame] | 28 | |
| 29 | private: |
Narayan Kamath | 788fa41 | 2014-01-21 15:32:36 +0000 | [diff] [blame] | 30 | bool match(int axis, const AxisValue& value) const; |
| 31 | |
| 32 | KeyedVector<int,SortedVector<AxisValue> > mData; |
Anton Krumin | a2ef5c0 | 2014-03-12 14:46:44 -0700 | [diff] [blame^] | 33 | bool mContainsPseudoAccented; |
| 34 | bool mContainsPseudoBidi; |
Dianne Hackborn | e6b6803 | 2011-10-13 16:26:02 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | #endif |