Lines Matching refs:id
48 return lhs->type < rhs.first || (lhs->type == rhs.first && rhs.second && lhs->id < rhs.second); in less_than_type_and_id()
60 return name_cmp < 0 || (name_cmp == 0 && rhs.second && lhs->id < rhs.second); in less_than_struct_with_name_and_id()
73 ResourceTablePackage* ResourceTable::FindPackageById(uint8_t id) const { in FindPackageById()
75 if (package->id && package->id.value() == id) { in FindPackageById()
82 ResourceTablePackage* ResourceTable::CreatePackage(const StringPiece& name, Maybe<uint8_t> id) { in CreatePackage() argument
85 if (id && !package->id) { in CreatePackage()
86 package->id = id; in CreatePackage()
90 if (id && package->id && package->id.value() != id.value()) { in CreatePackage()
97 const Maybe<uint8_t> id) { in CreatePackageAllowingDuplicateNames() argument
99 auto iter = std::lower_bound(packages.begin(), last, std::make_pair(name, id), in CreatePackageAllowingDuplicateNames()
102 if (iter != last && name == (*iter)->name && id == (*iter)->id) { in CreatePackageAllowingDuplicateNames()
108 new_package->id = id; in CreatePackageAllowingDuplicateNames()
125 ResourceTableType* ResourceTablePackage::FindType(ResourceType type, const Maybe<uint8_t> id) { in FindType() argument
127 auto iter = std::lower_bound(types.begin(), last, std::make_pair(type, id), in FindType()
129 if (iter != last && (*iter)->type == type && (!id || id == (*iter)->id)) { in FindType()
136 const Maybe<uint8_t> id) { in FindOrCreateType() argument
138 auto iter = std::lower_bound(types.begin(), last, std::make_pair(type, id), in FindOrCreateType()
140 if (iter != last && (*iter)->type == type && (!id || id == (*iter)->id)) { in FindOrCreateType()
145 new_type->id = id; in FindOrCreateType()
149 ResourceEntry* ResourceTableType::FindEntry(const StringPiece& name, const Maybe<uint16_t> id) { in FindEntry() argument
151 auto iter = std::lower_bound(entries.begin(), last, std::make_pair(name, id), in FindEntry()
153 if (iter != last && name == (*iter)->name && (!id || id == (*iter)->id)) { in FindEntry()
160 const Maybe<uint16_t > id) { in FindOrCreateEntry()
162 auto iter = std::lower_bound(entries.begin(), last, std::make_pair(name, id), in FindOrCreateEntry()
164 if (iter != last && name == (*iter)->name && (!id || id == (*iter)->id)) { in FindOrCreateEntry()
169 new_entry->id = id; in FindOrCreateEntry()
369 bool ResourceTable::AddResourceWithIdMangled(const ResourceNameRef& name, const ResourceId& id, in AddResourceWithIdMangled() argument
373 return AddResourceImpl(name, id, config, product, std::move(value), SkipNameValidator, in AddResourceWithIdMangled()
403 if (res_id.is_valid_dynamic() && package->id && package->id.value() != res_id.package_id()) { in AddResourceImpl()
407 << StringPrintf("%02x", package->id.value())); in AddResourceImpl()
420 if (check_id && type->id && type->id.value() != res_id.type_id()) { in AddResourceImpl()
424 << StringPrintf("%02x", type->id.value())); in AddResourceImpl()
432 if (check_id && entry->id && entry->id.value() != res_id.entry_id()) { in AddResourceImpl()
436 << ResourceId(package->id.value(), type->id.value(), entry->id.value())); in AddResourceImpl()
469 package->id = res_id.package_id(); in AddResourceImpl()
470 type->id = res_id.type_id(); in AddResourceImpl()
471 entry->id = res_id.entry_id(); in AddResourceImpl()
509 if (res_id.is_valid_dynamic() && package->id && package->id.value() != res_id.package_id()) { in SetVisibilityImpl()
513 << StringPrintf("%02x", package->id.value())); in SetVisibilityImpl()
526 if (check_id && type->id && type->id.value() != res_id.type_id()) { in SetVisibilityImpl()
530 << StringPrintf("%02x", type->id.value())); in SetVisibilityImpl()
538 if (check_id && entry->id && entry->id.value() != res_id.entry_id()) { in SetVisibilityImpl()
542 << ResourceId(package->id.value(), type->id.value(), entry->id.value())); in SetVisibilityImpl()
547 package->id = res_id.package_id(); in SetVisibilityImpl()
548 type->id = res_id.type_id(); in SetVisibilityImpl()
549 entry->id = res_id.entry_id(); in SetVisibilityImpl()
649 ResourceTablePackage* new_pkg = new_table->CreatePackage(pkg->name, pkg->id); in Clone()
652 new_type->id = type->id; in Clone()
657 new_entry->id = entry->id; in Clone()