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

Function parseXMLResource

tools/aapt/XMLNode.cpp:523–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

521}
522
523status_t parseXMLResource(const sp<AaptFile>& file, ResXMLTree* outTree,
524 bool stripAll, bool keepComments,
525 const char** cDataTags)
526{
527 sp<XMLNode> root = XMLNode::parse(file);
528 if (root == NULL) {
529 return UNKNOWN_ERROR;
530 }
531 root->removeWhitespace(stripAll, cDataTags);
532
533 NOISY(printf("Input XML from %s:\n", (const char*)file->getPrintableSource()));
534 NOISY(root->print());
535 sp<AaptFile> rsc = new AaptFile(String8(), AaptGroupEntry(), String8());
536 status_t err = root->flatten(rsc, !keepComments, false);
537 if (err != NO_ERROR) {
538 return err;
539 }
540 err = outTree->setTo(rsc->getData(), rsc->getSize(), true);
541 if (err != NO_ERROR) {
542 return err;
543 }
544
545 NOISY(printf("Output XML:\n"));
546 NOISY(printXMLBlock(outTree));
547
548 return NO_ERROR;
549}
550
551sp<XMLNode> XMLNode::parseFromZip(const sp<AaptFile>& file) {
552 AssetManager assets;

Callers 4

compileResourceFileFunction · 0.85
parsePackageFunction · 0.85
writeProguardForXmlFunction · 0.85

Calls 9

AaptGroupEntryClass · 0.85
printXMLBlockFunction · 0.85
removeWhitespaceMethod · 0.80
getPrintableSourceMethod · 0.80
getSizeMethod · 0.65
printMethod · 0.45
flattenMethod · 0.45
setToMethod · 0.45
getDataMethod · 0.45

Tested by

no test coverage detected