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.cpp81 const IdItem *idItem = hapManager_->FindResourceById(id); in GetStringById() local
82 if (idItem == nullptr) { in GetStringById()
86 RState state = GetString(idItem, outValue); in GetStringById()
95 const IdItem *idItem = hapManager_->FindResourceByName(name, ResType::STRING); in GetStringByName() local
96 if (idItem == nullptr) { in GetStringByName()
100 RState state = GetString(idItem, outValue); in GetStringByName()
109 const IdItem *idItem = hapManager_->FindResourceById(id); in GetStringFormatById() local
111 RState rState = GetString(idItem, temp); in GetStringFormatById()
124 const IdItem *idItem = hapManager_->FindResourceByName(name, ResType::STRING); in GetStringFormatByName() local
126 RState rState = GetString(idItem, temp); in GetStringFormatByName()
[all …]
Dhap_manager.cpp519 const IdItem *idItem = qd->GetIdItem(); in GetFilePathFromHap() local
520 if (idItem == nullptr || idItem->resType_ != resType) { in GetFilePathFromHap()
523 idItem == nullptr ? -1 : idItem->resType_, resType, hapPath.c_str()); in GetFilePathFromHap()
527 std::string tempFilePath(idItem->value_); in GetFilePathFromHap()
533 filePath = idItem->value_.substr(index + 1); in GetFilePathFromHap()
537 tempFilePath.append(idItem->value_); in GetFilePathFromHap()
757 const IdItem *idItem = vuqd->GetIdItem(); in GetFilePath() local
758 if (idItem == nullptr || idItem->resType_ != resType) { in GetFilePath()
763 auto index = idItem->value_.find('/'); in GetFilePath()
765 HILOG_ERROR("resource path format error, %s", idItem->value_.c_str()); in GetFilePath()
[all …]
Dhap_resource.cpp45 HapResource::ValueUnderQualifierDir::ValueUnderQualifierDir(const ResKey *resKey, IdItem *idItem, in ValueUnderQualifierDir() argument
50 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);
Dhap_resource.h97 ValueUnderQualifierDir(const std::vector<KeyParam *> &keyParams, IdItem *idItem,
Dglobal_utils.h102 int32_t (*GetIdItem)(int32_t file, uint32_t offset, IdItem *idItem);
/base/global/resource_management/frameworks/resmgr/include/
Dresource_manager_impl.h539 RState GetString(const IdItem *idItem, std::string &outValue);
541 RState GetStringArray(const IdItem *idItem, std::vector<std::string> &outValue);
543 RState GetPattern(const IdItem *idItem, std::map<std::string, std::string> &outValue);
545 RState GetTheme(const IdItem *idItem, std::map<std::string, std::string> &outValue);
551 RState GetBoolean(const IdItem *idItem, bool &outValue);
557 RState GetFloat(const IdItem *idItem, float &outValue, std::string &unit);
559 RState GetInteger(const IdItem *idItem, int &outValue);
561 RState GetColor(const IdItem *idItem, uint32_t &outValue);
563 RState GetIntArray(const IdItem *idItem, std::vector<int> &outValue);
567 … RState ResolveParentReference(const IdItem *idItem, std::map<std::string, std::string> &outValue);
Dhap_resource.h185 ValueUnderQualifierDir(const ResKey *resKey, 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.cpp403 int32_t ParseIdItem(const char *buffer, uint32_t &offset, IdItem *idItem) in ParseIdItem() argument
405 errno_t eret = memcpy_s(idItem, sizeof(IdItem), buffer + offset, IdItem::HEADER_LEN); in ParseIdItem()
411 idItem->JudgeArray(); in ParseIdItem()
412 if (idItem->isArray_) { in ParseIdItem()
413 int32_t ret = ParseStringArray(buffer, offset, idItem->values_); in ParseIdItem()
423 idItem->value_ = std::string(value); in ParseIdItem()
424 idItem->valueLen_ = value.size(); in ParseIdItem()
431 idItem->name_ = std::string(name); in ParseIdItem()
458 IdItem *idItem = new (std::nothrow) IdItem(); in ParseId() local
459 if (idItem == nullptr) { in ParseId()
[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.cpp1753 const IdItem *idItem; variable
1758 idItem = ((ResourceManagerImpl *)rm)->hapManager_->FindResourceById(id);
1759 ASSERT_TRUE(idItem != nullptr);
1760 ret = ((ResourceManagerImpl *)rm)->ResolveParentReference(idItem, outValue);
1766 idItem = ((ResourceManagerImpl *)rm)->hapManager_->FindResourceById(id);
1767 ASSERT_TRUE(idItem != nullptr);
1768 ret = ((ResourceManagerImpl *)rm)->ResolveParentReference(idItem, outValue);
1774 idItem = ((ResourceManagerImpl *)rm)->hapManager_->FindResourceById(id);
1775 ASSERT_TRUE(idItem != nullptr);
1776 ret = ((ResourceManagerImpl *)rm)->ResolveParentReference(idItem, outValue);