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

Method addEntry

tools/aapt/ResourceTable.cpp:1780–1819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1778}
1779
1780status_t ResourceTable::addEntry(const SourcePos& sourcePos,
1781 const String16& package,
1782 const String16& type,
1783 const String16& name,
1784 const String16& value,
1785 const Vector<StringPool::entry_style_span>* style,
1786 const ResTable_config* params,
1787 const bool doSetIndex,
1788 const int32_t format,
1789 const bool overwrite)
1790{
1791 // Check for adding entries in other packages... for now we do
1792 // nothing. We need to do the right thing here to support skinning.
1793 uint32_t rid = mAssets->getIncludedResources()
1794 .identifierForName(name.string(), name.size(),
1795 type.string(), type.size(),
1796 package.string(), package.size());
1797 if (rid != 0) {
1798 return NO_ERROR;
1799 }
1800
1801#if 0
1802 if (name == String16("left")) {
1803 printf("Adding entry left: file=%s, line=%d, type=%s, value=%s\n",
1804 sourcePos.file.string(), sourcePos.line, String8(type).string(),
1805 String8(value).string());
1806 }
1807#endif
1808
1809 sp<Entry> e = getEntry(package, type, name, sourcePos, overwrite,
1810 params, doSetIndex);
1811 if (e == NULL) {
1812 return UNKNOWN_ERROR;
1813 }
1814 status_t err = e->setItem(sourcePos, value, style, format, overwrite);
1815 if (err == NO_ERROR) {
1816 mNumLocal++;
1817 }
1818 return err;
1819}
1820
1821status_t ResourceTable::startBag(const SourcePos& sourcePos,
1822 const String16& package,

Callers 5

parseAndAddEntryFunction · 0.45
compileResourceFileFunction · 0.45
generateAttributesMethod · 0.45
getEntryMethod · 0.45
makeFileResourcesFunction · 0.45

Calls 5

identifierForNameMethod · 0.80
stringMethod · 0.80
String16Class · 0.70
sizeMethod · 0.65
setItemMethod · 0.45

Tested by

no test coverage detected