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

Function parseAndAddBag

tools/aapt/ResourceTable.cpp:570–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570status_t parseAndAddBag(Bundle* bundle,
571 const sp<AaptFile>& in,
572 ResXMLTree* block,
573 const ResTable_config& config,
574 const String16& myPackage,
575 const String16& curType,
576 const String16& ident,
577 const String16& parentIdent,
578 const String16& itemIdent,
579 int32_t curFormat,
580 bool isFormatted,
581 const String16& product,
582 bool pseudolocalize,
583 const bool overwrite,
584 ResourceTable* outTable)
585{
586 status_t err;
587 const String16 item16("item");
588
589 String16 str;
590 Vector<StringPool::entry_style_span> spans;
591 err = parseStyledString(bundle, in->getPrintableSource().string(),
592 block, item16, &str, &spans, isFormatted,
593 pseudolocalize);
594 if (err != NO_ERROR) {
595 return err;
596 }
597
598 NOISY(printf("Adding resource bag entry l=%c%c c=%c%c orien=%d d=%d "
599 " pid=%s, bag=%s, id=%s: %s\n",
600 config.language[0], config.language[1],
601 config.country[0], config.country[1],
602 config.orientation, config.density,
603 String8(parentIdent).string(),
604 String8(ident).string(),
605 String8(itemIdent).string(),
606 String8(str).string()));
607
608 err = outTable->addBag(SourcePos(in->getPrintableSource(), block->getLineNumber()),
609 myPackage, curType, ident, parentIdent, itemIdent, str,
610 &spans, &config, overwrite, false, curFormat);
611 return err;
612}
613
614/*
615 * Returns true if needle is one of the elements in the comma-separated list

Callers 1

compileResourceFileFunction · 0.85

Calls 6

parseStyledStringFunction · 0.85
SourcePosClass · 0.85
stringMethod · 0.80
getPrintableSourceMethod · 0.80
addBagMethod · 0.80
getLineNumberMethod · 0.45

Tested by

no test coverage detected