MCPcopy Create free account
hub / github.com/CyanogenMod/android_frameworks_base / parseValues

Method parseValues

tools/aapt/XMLNode.cpp:932–964  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

930}
931
932status_t XMLNode::parseValues(const sp<AaptAssets>& assets,
933 ResourceTable* table)
934{
935 bool hasErrors = false;
936
937 if (getType() == TYPE_ELEMENT) {
938 const size_t N = mAttributes.size();
939 String16 defPackage(assets->getPackage());
940 for (size_t i=0; i<N; i++) {
941 attribute_entry& e = mAttributes.editItemAt(i);
942 AccessorCookie ac(SourcePos(mFilename, getStartLineNumber()), String8(e.name),
943 String8(e.string));
944 table->setCurrentXmlPos(SourcePos(mFilename, getStartLineNumber()));
945 if (!assets->getIncludedResources()
946 .stringToValue(&e.value, &e.string,
947 e.string.string(), e.string.size(), true, true,
948 e.nameResId, NULL, &defPackage, table, &ac)) {
949 hasErrors = true;
950 }
951 NOISY(printf("Attr %s: type=0x%x, str=%s\n",
952 String8(e.name).string(), e.value.dataType,
953 String8(e.string).string()));
954 }
955 }
956 const size_t N = mChildren.size();
957 for (size_t i=0; i<N; i++) {
958 status_t err = mChildren.itemAt(i)->parseValues(assets, table);
959 if (err != NO_ERROR) {
960 hasErrors = true;
961 }
962 }
963 return hasErrors ? UNKNOWN_ERROR : NO_ERROR;
964}
965
966status_t XMLNode::assignResourceIds(const sp<AaptAssets>& assets,
967 const ResourceTable* table)

Callers 1

compileXmlFileFunction · 0.80

Calls 7

getTypeFunction · 0.85
SourcePosClass · 0.85
setCurrentXmlPosMethod · 0.80
stringMethod · 0.80
sizeMethod · 0.65
getPackageMethod · 0.45
stringToValueMethod · 0.45

Tested by

no test coverage detected