Merge change I6478884a into eclair-mr2

* changes:
  Add string resource type inspection
This commit is contained in:
Android (Google) Code Review 2009-12-10 18:05:19 -08:00
commit 2c05ff5518
2 changed files with 13 additions and 1 deletions

View File

@ -454,6 +454,10 @@ public:
size_t size() const;
#ifndef HAVE_ANDROID_OS
bool isUTF8() const;
#endif
private:
status_t mError;
void* mOwnedData;

View File

@ -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) {