X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/dadd9c1fc18bd05c84a357b56e945b5829b3bd95..a5935dae7b4ebf74f45dec59f9b41b11a664e2bd:/ResourceTable.h diff --git a/ResourceTable.h b/ResourceTable.h index b36234d..74ba326 100644 --- a/ResourceTable.h +++ b/ResourceTable.h @@ -10,6 +10,11 @@ #include "StringPool.h" #include "SourcePos.h" +#include +#include + +using namespace std; + class ResourceTable; enum { @@ -33,6 +38,7 @@ status_t compileResourceFile(Bundle* bundle, const sp& assets, const sp& in, const ResTable_config& defParams, + const bool overwrite, ResourceTable* outTable); struct AccessorCookie @@ -74,7 +80,8 @@ public: const Vector* style = NULL, const ResTable_config* params = NULL, const bool doSetIndex = false, - const int32_t format = ResTable_map::TYPE_ANY); + const int32_t format = ResTable_map::TYPE_ANY, + const bool overwrite = false); status_t startBag(const SourcePos& pos, const String16& package, @@ -136,12 +143,14 @@ public: uint32_t getResId(const String16& package, const String16& type, - const String16& name) const; + const String16& name, + bool onlyPublic = false) const; uint32_t getResId(const String16& ref, const String16* defType = NULL, const String16* defPackage = NULL, - const char** outErrorMsg = NULL) const; + const char** outErrorMsg = NULL, + bool onlyPublic = false) const; static bool isValidResourceName(const String16& s); @@ -155,6 +164,8 @@ public: status_t assignResourceIds(); status_t addSymbols(const sp& outSymbols = NULL); + void addLocalization(const String16& name, const String8& locale); + status_t validateLocalizations(void); status_t flatten(Bundle*, const sp& dest); @@ -243,11 +254,14 @@ public: String16 getParent() const { return mParent; } status_t makeItABag(const SourcePos& sourcePos); - + + status_t emptyBag(const SourcePos& sourcePos); + status_t setItem(const SourcePos& pos, const String16& value, const Vector* style = NULL, - int32_t format = ResTable_map::TYPE_ANY); + int32_t format = ResTable_map::TYPE_ANY, + const bool overwrite = false); status_t addToBag(const SourcePos& pos, const String16& key, const String16& value, @@ -491,7 +505,6 @@ private: String16 mAssetsPackage; sp mAssets; - DefaultKeyedVector > mPublicNames; DefaultKeyedVector > mPackages; Vector > mOrderedPackages; uint32_t mNextPackageId; @@ -500,6 +513,9 @@ private: size_t mNumLocal; SourcePos mCurrentXmlPos; Bundle* mBundle; + + // key = string resource name, value = set of locales in which that name is defined + map > mLocalizations; }; class ResourceFilter