summaryrefslogtreecommitdiff
path: root/tools/aapt/ResourceTable.h
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-03-09 16:55:23 -0800
committerKenny Root <kroot@google.com>2010-03-09 20:56:41 -0800
commit7b467d8b44c00d14590c021928b6a9ad5a36348e (patch)
tree35a46a47d27f92d94e0bb7c4ecfc1ab2bd90a928 /tools/aapt/ResourceTable.h
parent4aaf256e95de9d09936b37a6c44e1200e751324e (diff)
Dedupe resource config pointers
When there are two configs in a StringPool that would match a string ID only keep the more generic entry to save some space. This means that if you have both "es" and "es_US" translations that have the same translation, the string entry would be removed from the "es_US" config. Change-Id: I4d619942d35ddb477e2eabe4437b7f02697c24de
Diffstat (limited to 'tools/aapt/ResourceTable.h')
-rw-r--r--tools/aapt/ResourceTable.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/aapt/ResourceTable.h b/tools/aapt/ResourceTable.h
index 186c7ca8fdd8..cc2a42924a8d 100644
--- a/tools/aapt/ResourceTable.h
+++ b/tools/aapt/ResourceTable.h
@@ -376,6 +376,10 @@ public:
void addEntry(const ResTable_config& config, const sp<Entry>& entry) {
mEntries.add(config, entry);
}
+
+ void removeEntryAt(int32_t index) {
+ mEntries.removeItemsAt(index);
+ }
const DefaultKeyedVector<ConfigDescription, sp<Entry> >& getEntries() const { return mEntries; }
private:
@@ -448,6 +452,9 @@ public:
const DefaultKeyedVector<String16, sp<ConfigList> >& getConfigs() const { return mConfigs; }
const Vector<sp<ConfigList> >& getOrderedConfigs() const { return mOrderedConfigs; }
+ void removeUniqueConfig(ConfigDescription& config) { mUniqueConfigs.remove(config); }
+ void removeOrderedConfigAt(uint32_t index) { mOrderedConfigs.removeItemsAt(index); }
+
const SortedVector<String16>& getCanAddEntries() const { return mCanAddEntries; }
const SourcePos& getPos() const { return mPos; }
@@ -558,5 +565,17 @@ private:
bool mContainsPseudo;
};
+class ResourceConfigReferences
+{
+public:
+ ResourceConfigReferences() : mRoots() {}
+ ~ResourceConfigReferences();
+ status_t add(uint32_t id, const ResTable_config& config);
+ bool isRoot(uint32_t id, const ResTable_config& config);
+ void dump();
+
+private:
+ KeyedVector<uint32_t, Vector<const ResTable_config*> > mRoots;
+};
#endif