summaryrefslogtreecommitdiffstats
path: root/tools/aapt/ResourceFilter.h
blob: 647b7bbfdd23ac3a57904ff91a611fcd94335374 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// Copyright 2011 The Android Open Source Project
//
// Build resource files from raw assets.
//

#ifndef RESOURCE_FILTER_H
#define RESOURCE_FILTER_H

#include "AaptAssets.h"

/**
 * Implements logic for parsing and handling "-c" and "--preferred-configurations"
 * options.
 */
class ResourceFilter
{
public:
    ResourceFilter() : mData(), mContainsPseudo(false) {}
    status_t parse(const char* arg);
    bool isEmpty() const;
    bool match(int axis, uint32_t value) const;
    bool match(int axis, const ResTable_config& config) const;
    bool match(const ResTable_config& config) const;
    const SortedVector<uint32_t>* configsForAxis(int axis) const;
    inline bool containsPseudo() const { return mContainsPseudo; }

private:
    KeyedVector<int,SortedVector<uint32_t> > mData;
    bool mContainsPseudo;
};

#endif