diff options
| author | 2009-12-10 18:05:19 -0800 | |
|---|---|---|
| committer | 2009-12-10 18:05:19 -0800 | |
| commit | 2c05ff5518f07889af1446c99d97198dc92e82cc (patch) | |
| tree | f00cf8b8506854939deac5e1390fd2a398ae215c | |
| parent | f4f3a4680744a90a0835d6594093dfef6bfcfc97 (diff) | |
| parent | ccb5b89029ca3f653fbfa32a7b6ed82bf227541c (diff) | |
Merge change I6478884a into eclair-mr2
* changes:
Add string resource type inspection
| -rw-r--r-- | include/utils/ResourceTypes.h | 4 | ||||
| -rw-r--r-- | libs/utils/ResourceTypes.cpp | 10 |
2 files changed, 13 insertions, 1 deletions
diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h index a845908f9e..6090f6001a 100644 --- a/include/utils/ResourceTypes.h +++ b/include/utils/ResourceTypes.h @@ -454,6 +454,10 @@ public: size_t size() const; +#ifndef HAVE_ANDROID_OS + bool isUTF8() const; +#endif + private: status_t mError; void* mOwnedData; diff --git a/libs/utils/ResourceTypes.cpp b/libs/utils/ResourceTypes.cpp index afca814fd0..e8bd5cf011 100644 --- a/libs/utils/ResourceTypes.cpp +++ b/libs/utils/ResourceTypes.cpp @@ -576,6 +576,13 @@ size_t ResStringPool::size() const return (mError == NO_ERROR) ? mHeader->stringCount : 0; } +#ifndef HAVE_ANDROID_OS +bool ResStringPool::isUTF8() const +{ + return (mHeader->flags&ResStringPool_header::UTF8_FLAG)!=0; +} +#endif + // -------------------------------------------------------------------- // -------------------------------------------------------------------- // -------------------------------------------------------------------- @@ -4016,7 +4023,8 @@ void ResTable::print_value(const Package* pkg, const Res_value& value) const if (str == NULL) { printf("(string) null\n"); } else { - printf("(string) \"%s\"\n", + printf("(string%d) \"%s\"\n", + pkg->header->values.isUTF8()?8:16, String8(str, len).string()); } } else if (value.dataType == Res_value::TYPE_FLOAT) { |