ResourceFilter.h revision a2ef5c0d4fb863c0382e77ae00f986a019b11cbe
1e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn// 2e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn// Copyright 2011 The Android Open Source Project 3e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn// 4e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn// Build resource files from raw assets. 5e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn// 6e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn 7e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn#ifndef RESOURCE_FILTER_H 8e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn#define RESOURCE_FILTER_H 9e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn 10e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn#include "AaptAssets.h" 11e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn 12e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn/** 13e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn * Implements logic for parsing and handling "-c" and "--preferred-configurations" 14e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn * options. 15e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn */ 16e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackbornclass ResourceFilter 17e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn{ 18e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackbornpublic: 19a2ef5c0d4fb863c0382e77ae00f986a019b11cbeAnton Krumin ResourceFilter() : mData(), mContainsPseudoAccented(false), 20a2ef5c0d4fb863c0382e77ae00f986a019b11cbeAnton Krumin mContainsPseudoBidi(false) {} 21e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn status_t parse(const char* arg); 22e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn bool isEmpty() const; 23e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn bool match(int axis, const ResTable_config& config) const; 24e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn bool match(const ResTable_config& config) const; 25788fa41482b9d398591b7db8b0b01839029611adNarayan Kamath const SortedVector<AxisValue>* configsForAxis(int axis) const; 26a2ef5c0d4fb863c0382e77ae00f986a019b11cbeAnton Krumin inline bool containsPseudo() const { return mContainsPseudoAccented; } 27a2ef5c0d4fb863c0382e77ae00f986a019b11cbeAnton Krumin inline bool containsPseudoBidi() const { return mContainsPseudoBidi; } 28e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn 29e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackbornprivate: 30788fa41482b9d398591b7db8b0b01839029611adNarayan Kamath bool match(int axis, const AxisValue& value) const; 31788fa41482b9d398591b7db8b0b01839029611adNarayan Kamath 32788fa41482b9d398591b7db8b0b01839029611adNarayan Kamath KeyedVector<int,SortedVector<AxisValue> > mData; 33a2ef5c0d4fb863c0382e77ae00f986a019b11cbeAnton Krumin bool mContainsPseudoAccented; 34a2ef5c0d4fb863c0382e77ae00f986a019b11cbeAnton Krumin bool mContainsPseudoBidi; 35e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn}; 36e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn 37e6b680364dd992907a8d2037685a2e500d188dfbDianne Hackborn#endif 38