ResourceFilter.h revision 788fa41482b9d398591b7db8b0b01839029611ad
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 */
16class ResourceFilter
17{
18public:
19    ResourceFilter() : mData(), mContainsPseudo(false) {}
20    status_t parse(const char* arg);
21    bool isEmpty() const;
22    bool match(int axis, const ResTable_config& config) const;
23    bool match(const ResTable_config& config) const;
24    const SortedVector<AxisValue>* configsForAxis(int axis) const;
25    inline bool containsPseudo() const { return mContainsPseudo; }
26
27private:
28    bool match(int axis, const AxisValue& value) const;
29
30    KeyedVector<int,SortedVector<AxisValue> > mData;
31    bool mContainsPseudo;
32};
33
34#endif
35