Home
last modified time | relevance | path

Searched refs:idItem (Results 1 – 17 of 17) sorted by relevance

/base/global/resource_management_lite/frameworks/resmgr_lite/src/
Dresource_manager_impl.cpp73 const IdItem *idItem = hapManager_->FindResourceById(id); in GetStringById() local
74 return GetString(idItem, outValue); in GetStringById()
79 const IdItem *idItem = hapManager_->FindResourceByName(name, ResType::STRING); in GetStringByName() local
80 return GetString(idItem, outValue); in GetStringByName()
85 const IdItem *idItem = hapManager_->FindResourceById(id); in GetStringFormatById() local
87 RState rState = GetString(idItem, temp); in GetStringFormatById()
100 const IdItem *idItem = hapManager_->FindResourceByName(name, ResType::STRING); in GetStringFormatByName() local
102 RState rState = GetString(idItem, temp); in GetStringFormatByName()
113 RState ResourceManagerImpl::GetString(const IdItem *idItem, std::string &outValue) in GetString() argument
116 if (idItem == nullptr || idItem->resType_ != ResType::STRING) { in GetString()
[all …]
Dglobal.c130 static void FreeIdItem(IdItem *idItem) in FreeIdItem() argument
132 if (idItem == NULL) { in FreeIdItem()
135 free(idItem->value); in FreeIdItem()
136 free(idItem->name); in FreeIdItem()
137 idItem->value = NULL; in FreeIdItem()
138 idItem->name = NULL; in FreeIdItem()
170 IdItem idItem = {0, INVALID_RES_TYPE, 0, 0, NULL, 0, NULL}; in GLOBAL_GetValueByIdInternal() local
173 ret = utilsImpl->GetIdItem(file, idHeader.idParams[i].offset, &idItem); in GLOBAL_GetValueByIdInternal()
179 *value = (char *)malloc(idItem.valueLen); in GLOBAL_GetValueByIdInternal()
180 if (*value == NULL || strcpy_s(*value, idItem.valueLen, idItem.value) != EOK) { in GLOBAL_GetValueByIdInternal()
[all …]
Dglobal.cpp121 int32_t GetValue(const IdItem *idItem, char **value) in GetValue() argument
123 if (idItem == nullptr) { in GetValue()
126 if (idItem->isArray_) { in GetValue()
128 for (size_t i = 0; i < idItem->values_.size(); ++i) { in GetValue()
129 ret.append(FormatString("'%s',", idItem->values_[i].c_str())); in GetValue()
139 *value = static_cast<char *>(malloc(idItem->valueLen_ + 1)); in GetValue()
140 … if (*value == nullptr || strcpy_s(*value, idItem->valueLen_ + 1, idItem->value_.c_str()) != EOK) { in GetValue()
144 (*value)[idItem->valueLen_] = '\0'; in GetValue()
173 auto idItem = hapManager.FindResourceById(id); in GLOBAL_GetValueById() local
174 if (idItem == nullptr) { in GLOBAL_GetValueById()
[all …]
Dglobal_utils.c52 static int32_t GetIdItem(int32_t file, uint32_t offset, IdItem *idItem);
425 static int32_t GetIdItem(int32_t file, uint32_t offset, IdItem *idItem) in GetIdItem() argument
427 if (offset == INVALID_OFFSET || file == -1 || idItem == NULL) { in GetIdItem()
437 idItem->size = ConvertUint8ArrayToUint32(defaultCache, INDEX_DEFAULT_OFFSET); in GetIdItem()
440 idItem->resType = (ResType)ConvertUint8ArrayToUint32(defaultCache, INDEX_DEFAULT_OFFSET); in GetIdItem()
443 idItem->id = ConvertUint8ArrayToUint32(defaultCache, INDEX_DEFAULT_OFFSET); in GetIdItem()
446 idItem->valueLen = (uint16_t)ConvertUint8ArrayToUint32(lengthCache, VALUE_LENGTH_OFFSET); in GetIdItem()
447 if (idItem->valueLen == 0 || idItem->valueLen > MAX_ITEM_LENGTH) { in GetIdItem()
451 idItem->value = (char *)malloc(idItem->valueLen); in GetIdItem()
452 if (idItem->value == NULL) { in GetIdItem()
[all …]
Dhap_resource.cpp34 …UnderQualifierDir::ValueUnderQualifierDir(const std::vector<KeyParam *> &keyParams, IdItem *idItem, in ValueUnderQualifierDir() argument
39 idItem_ = idItem; in ValueUnderQualifierDir()
/base/global/resource_management/frameworks/resmgr/src/
Dresource_manager_impl.cpp93 const std::shared_ptr<IdItem> idItem = hapManager_->FindResourceById(id, isOverrideResMgr_); in GetStringById() local
94 if (idItem == nullptr) { in GetStringById()
98 RState state = GetString(idItem, outValue); in GetStringById()
107 …const std::shared_ptr<IdItem> idItem = hapManager_->FindResourceByName(name, ResType::STRING, isOv… in GetStringByName() local
108 if (idItem == nullptr) { in GetStringByName()
112 RState state = GetString(idItem, outValue); in GetStringByName()
121 const std::shared_ptr<IdItem> idItem = hapManager_->FindResourceById(id, isOverrideResMgr_); in GetStringFormatById() local
123 RState rState = GetString(idItem, temp); in GetStringFormatById()
136 …const std::shared_ptr<IdItem> idItem = hapManager_->FindResourceByName(name, ResType::STRING, isOv… in GetStringFormatByName() local
138 RState rState = GetString(idItem, temp); in GetStringFormatByName()
[all …]
Dhap_manager.cpp560 const std::shared_ptr<IdItem> idItem = qd->GetIdItem(); in GetFilePathFromHap() local
561 if (idItem == nullptr || idItem->resType_ != resType) { in GetFilePathFromHap()
564 idItem == nullptr ? -1 : idItem->resType_, resType, hapPath.c_str()); in GetFilePathFromHap()
568 std::string tempFilePath(idItem->value_); in GetFilePathFromHap()
574 filePath = idItem->value_.substr(index + 1); in GetFilePathFromHap()
578 tempFilePath.append(idItem->value_); in GetFilePathFromHap()
830 const std::shared_ptr<IdItem> idItem = vuqd->GetIdItem(); in GetFilePath() local
831 if (idItem == nullptr || idItem->resType_ != resType) { in GetFilePath()
836 auto index = idItem->value_.find('/'); in GetFilePath()
838 HILOG_ERROR("resource path format error, %s", idItem->value_.c_str()); in GetFilePath()
[all …]
Dhap_resource.cpp46 …std::shared_ptr<IdItem> idItem, const std::pair<std::string, std::string> &resPath, bool isOverlay, in ValueUnderQualifierDir() argument
51 idItem_ = idItem; in ValueUnderQualifierDir()
/base/global/resource_management_lite/frameworks/resmgr_lite/include/
Dresource_manager_impl.h284 RState GetString(const IdItem *idItem, std::string &outValue);
286 RState GetStringArray(const IdItem *idItem, std::vector<std::string> &outValue);
288 RState GetPattern(const IdItem *idItem, std::map<std::string, std::string> &outValue);
290 RState GetTheme(const IdItem *idItem, std::map<std::string, std::string> &outValue);
296 RState GetBoolean(const IdItem *idItem, bool &outValue);
298 RState GetFloat(const IdItem *idItem, float &outValue);
300 RState GetInteger(const IdItem *idItem, int &outValue);
302 RState GetColor(const IdItem *idItem, uint32_t &outValue);
304 RState GetIntArray(const IdItem *idItem, std::vector<int> &outValue);
308 … RState ResolveParentReference(const IdItem *idItem, std::map<std::string, std::string> &outValue);
Dglobal_utils.h102 int32_t (*GetIdItem)(int32_t file, uint32_t offset, IdItem *idItem);
Dhap_resource.h97 ValueUnderQualifierDir(const std::vector<KeyParam *> &keyParams, IdItem *idItem,
/base/global/resource_management/frameworks/resmgr/include/
Dresource_manager_impl.h669 RState GetString(const std::shared_ptr<IdItem> idItem, std::string &outValue);
671 RState GetStringArray(const std::shared_ptr<IdItem> idItem, std::vector<std::string> &outValue);
673 …RState GetPattern(const std::shared_ptr<IdItem> idItem, std::map<std::string, std::string> &outVal…
675 …RState GetTheme(const std::shared_ptr<IdItem> idItem, std::map<std::string, std::string> &outValue…
682 RState GetBoolean(const std::shared_ptr<IdItem> idItem, bool &outValue);
688 RState GetFloat(const std::shared_ptr<IdItem> idItem, float &outValue, std::string &unit);
690 RState GetInteger(const std::shared_ptr<IdItem> idItem, int &outValue);
692 RState GetColor(const std::shared_ptr<IdItem> idItem, uint32_t &outValue);
694 RState GetIntArray(const std::shared_ptr<IdItem> idItem, std::vector<int> &outValue);
696 RState GetSymbol(const std::shared_ptr<IdItem> idItem, uint32_t &outValue);
[all …]
Dhap_resource.h195 ValueUnderQualifierDir(const std::shared_ptr<ResKey> resKey, std::shared_ptr<IdItem> idItem,
/base/global/resource_management_lite/frameworks/resmgr_lite/src/utils/
Dhap_parser.cpp215 int32_t ParseIdItem(const char *buffer, uint32_t &offset, IdItem *idItem) in ParseIdItem() argument
217 errno_t eret = memcpy_s(idItem, sizeof(IdItem), buffer + offset, IdItem::HEADER_LEN); in ParseIdItem()
223 idItem->JudgeArray(); in ParseIdItem()
224 if (idItem->isArray_) { in ParseIdItem()
225 int32_t ret = ParseStringArray(buffer, offset, idItem->values_); in ParseIdItem()
235 idItem->value_ = std::string(value); in ParseIdItem()
236 idItem->valueLen_ = value.size(); in ParseIdItem()
243 idItem->name_ = std::string(name); in ParseIdItem()
270 IdItem *idItem = new (std::nothrow) IdItem(); in ParseId() local
271 if (idItem == nullptr) { in ParseId()
[all …]
/base/global/resource_management/frameworks/resmgr/src/utils/
Dhap_parser.cpp453 int32_t ParseIdItem(const char *buffer, uint32_t &offset, std::shared_ptr<IdItem> idItem, const uin… in ParseIdItem() argument
455 errno_t eret = memcpy_s(idItem.get(), sizeof(IdItem), buffer + offset, IdItem::HEADER_LEN); in ParseIdItem()
459 if (selectedTypes != SELECT_ALL && (selectedTypes & ConvertType(idItem->resType_)) == 0) { in ParseIdItem()
464 idItem->JudgeArray(); in ParseIdItem()
465 if (idItem->isArray_) { in ParseIdItem()
466 int32_t ret = ParseStringArray(buffer, offset, idItem->values_); in ParseIdItem()
471 int32_t ret = ParseString(buffer, offset, idItem->value_); in ParseIdItem()
475 idItem->valueLen_ = idItem->value_.size(); in ParseIdItem()
477 int32_t ret = ParseString(buffer, offset, idItem->name_); in ParseIdItem()
506 std::shared_ptr<IdItem> idItem = std::make_shared<IdItem>(); in ParseId() local
[all …]
/base/global/resource_management_lite/frameworks/resmgr_lite/test/unittest/lite/common/
Dresource_manager_test.cpp1638 const IdItem *idItem; variable
1643 idItem = ((ResourceManagerImpl *)rm)->hapManager_->FindResourceById(id);
1644 ASSERT_TRUE(idItem != nullptr);
1645 ret = ((ResourceManagerImpl *)rm)->ResolveParentReference(idItem, outValue);
1652 idItem = ((ResourceManagerImpl *)rm)->hapManager_->FindResourceById(id);
1653 ASSERT_TRUE(idItem != nullptr);
1654 ret = ((ResourceManagerImpl *)rm)->ResolveParentReference(idItem, outValue);
1661 idItem = ((ResourceManagerImpl *)rm)->hapManager_->FindResourceById(id);
1662 ASSERT_TRUE(idItem != nullptr);
1663 ret = ((ResourceManagerImpl *)rm)->ResolveParentReference(idItem, outValue);
/base/global/resource_management/frameworks/resmgr/test/unittest/common/
Dresource_manager_test.cpp1776 auto idItem = ((ResourceManagerImpl *)rm)->hapManager_->FindResourceById(id); variable
1777 ASSERT_TRUE(idItem != nullptr);
1778 ret = ((ResourceManagerImpl *)rm)->ResolveParentReference(idItem, outValue);
1784 idItem = ((ResourceManagerImpl *)rm)->hapManager_->FindResourceById(id);
1785 ASSERT_TRUE(idItem != nullptr);
1786 ret = ((ResourceManagerImpl *)rm)->ResolveParentReference(idItem, outValue);
1792 idItem = ((ResourceManagerImpl *)rm)->hapManager_->FindResourceById(id);
1793 ASSERT_TRUE(idItem != nullptr);
1794 ret = ((ResourceManagerImpl *)rm)->ResolveParentReference(idItem, outValue);