X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/7b055f4f9c266cf8c50488db7086cc2e168113fd..5b1571926646584beb8133b65a5ed90bd0f63c0e:/AaptAssets.h diff --git a/AaptAssets.h b/AaptAssets.h index 52751c7..d5f296c 100644 --- a/AaptAssets.h +++ b/AaptAssets.h @@ -7,14 +7,14 @@ #define __AAPT_ASSETS_H #include -#include +#include +#include #include -#include -#include +#include #include #include +#include #include -#include #include "ZipFile.h" #include "Bundle.h" @@ -57,17 +57,6 @@ enum { AXIS_END = AXIS_VERSION, }; -enum { - SDK_CUPCAKE = 3, - SDK_DONUT = 4, - SDK_ECLAIR = 5, - SDK_ECLAIR_0_1 = 6, - SDK_MR1 = 7, - SDK_FROYO = 8, - SDK_HONEYCOMB_MR2 = 13, - SDK_ICE_CREAM_SANDWICH = 14, -}; - /** * This structure contains a specific variation of a single file out * of all the variations it can have that we can have. @@ -330,16 +319,16 @@ class AaptSymbolEntry { public: AaptSymbolEntry() - : isPublic(false), typeCode(TYPE_UNKNOWN) + : isPublic(false), isJavaSymbol(false), typeCode(TYPE_UNKNOWN) { } AaptSymbolEntry(const String8& _name) - : name(_name), isPublic(false), typeCode(TYPE_UNKNOWN) + : name(_name), isPublic(false), isJavaSymbol(false), typeCode(TYPE_UNKNOWN) { } AaptSymbolEntry(const AaptSymbolEntry& o) : name(o.name), sourcePos(o.sourcePos), isPublic(o.isPublic) - , comment(o.comment), typeComment(o.typeComment) + , isJavaSymbol(o.isJavaSymbol), comment(o.comment), typeComment(o.typeComment) , typeCode(o.typeCode), int32Val(o.int32Val), stringVal(o.stringVal) { } @@ -347,6 +336,7 @@ public: { sourcePos = o.sourcePos; isPublic = o.isPublic; + isJavaSymbol = o.isJavaSymbol; comment = o.comment; typeComment = o.typeComment; typeCode = o.typeCode; @@ -359,6 +349,7 @@ public: SourcePos sourcePos; bool isPublic; + bool isJavaSymbol; String16 comment; String16 typeComment; @@ -416,6 +407,15 @@ public: return NO_ERROR; } + status_t makeSymbolJavaSymbol(const String8& name, const SourcePos& pos) { + if (!check_valid_symbol_name(name, pos, "symbol")) { + return BAD_VALUE; + } + AaptSymbolEntry& sym = edit_symbol(name, &pos); + sym.isJavaSymbol = true; + return NO_ERROR; + } + void appendComment(const String8& name, const String16& comment, const SourcePos& pos) { if (comment.size() <= 0) { return; @@ -456,6 +456,8 @@ public: return sym; } + status_t applyJavaSymbols(const sp& javaSymbols); + const KeyedVector& getSymbols() const { return mSymbols; } const DefaultKeyedVector >& getNestedSymbols() const @@ -524,7 +526,11 @@ public: virtual ~AaptAssets() { delete mRes; } const String8& getPackage() const { return mPackage; } - void setPackage(const String8& package) { mPackage = package; mSymbolsPrivatePackage = package; } + void setPackage(const String8& package) { + mPackage = package; + mSymbolsPrivatePackage = package; + mHavePrivateSymbols = false; + } const SortedVector& getGroupEntries() const; @@ -547,11 +553,22 @@ public: sp getSymbolsFor(const String8& name); + sp getJavaSymbolsFor(const String8& name); + + status_t applyJavaSymbols(); + const DefaultKeyedVector >& getSymbols() const { return mSymbols; } String8 getSymbolsPrivatePackage() const { return mSymbolsPrivatePackage; } - void setSymbolsPrivatePackage(const String8& pkg) { mSymbolsPrivatePackage = pkg; } - + void setSymbolsPrivatePackage(const String8& pkg) { + mSymbolsPrivatePackage = pkg; + mHavePrivateSymbols = mSymbolsPrivatePackage != mPackage; + } + + bool havePrivateSymbols() const { return mHavePrivateSymbols; } + + bool isJavaSymbol(const AaptSymbolEntry& sym, bool includePrivate) const; + status_t buildIncludedResources(Bundle* bundle); status_t addIncludedResources(const sp& file); const ResTable& getIncludedResources() const; @@ -591,7 +608,9 @@ private: String8 mPackage; SortedVector mGroupEntries; DefaultKeyedVector > mSymbols; + DefaultKeyedVector > mJavaSymbols; String8 mSymbolsPrivatePackage; + bool mHavePrivateSymbols; Vector > mResDirs;