Lines Matching refs:unifiedData

108 static OH_UdmfRecord** CreateUnifiedDataRecordsArray(OH_UdmfData* unifiedData,  in CreateUnifiedDataRecordsArray()  argument
112 if (unifiedData == nullptr || size == 0 || size > MAX_RECORDS_COUNT) { in CreateUnifiedDataRecordsArray()
127 unifiedData->records = result; in CreateUnifiedDataRecordsArray()
128 unifiedData->recordsCount = size; in CreateUnifiedDataRecordsArray()
129 return unifiedData->records; in CreateUnifiedDataRecordsArray()
181 int OH_UdmfData_AddRecord(OH_UdmfData* unifiedData, OH_UdmfRecord* record) in OH_UdmfData_AddRecord() argument
183 if (!IsUnifiedDataValid(unifiedData) || !IsUnifiedRecordValid(record)) { in OH_UdmfData_AddRecord()
186 unifiedData->unifiedData_->AddRecord(record->record_); in OH_UdmfData_AddRecord()
190 bool OH_UdmfData_HasType(OH_UdmfData* unifiedData, const char* type) in OH_UdmfData_HasType() argument
192 …return IsUnifiedDataValid(unifiedData) && type != nullptr && unifiedData->unifiedData_->HasTypeInE… in OH_UdmfData_HasType()
195 char** OH_UdmfData_GetTypes(OH_UdmfData* unifiedData, unsigned int* count) in OH_UdmfData_GetTypes() argument
197 if (!IsUnifiedDataValid(unifiedData) || count == nullptr) { in OH_UdmfData_GetTypes()
200 std::lock_guard<std::mutex> lock(unifiedData->mutex); in OH_UdmfData_GetTypes()
201 if (unifiedData->typesArray != nullptr) { in OH_UdmfData_GetTypes()
203 *count = unifiedData->typesCount; in OH_UdmfData_GetTypes()
204 return unifiedData->typesArray; in OH_UdmfData_GetTypes()
206 std::vector<std::string> typeLabels = unifiedData->unifiedData_->GetEntriesTypes(); in OH_UdmfData_GetTypes()
208 unifiedData->typesArray = StrVectorToTypesArray(typeLabels); in OH_UdmfData_GetTypes()
209unifiedData->typesArray == nullptr ? unifiedData->typesCount = 0 : unifiedData->typesCount = typeL… in OH_UdmfData_GetTypes()
210 *count = unifiedData->typesCount; in OH_UdmfData_GetTypes()
211 return unifiedData->typesArray; in OH_UdmfData_GetTypes()
234 OH_UdmfRecord** OH_UdmfData_GetRecords(OH_UdmfData* unifiedData, unsigned int* count) in OH_UdmfData_GetRecords() argument
236 if (!IsUnifiedDataValid(unifiedData) || count == nullptr) { in OH_UdmfData_GetRecords()
239 std::lock_guard<std::mutex> lock(unifiedData->mutex); in OH_UdmfData_GetRecords()
240 if (unifiedData->records != nullptr) { in OH_UdmfData_GetRecords()
242 *count = unifiedData->recordsCount; in OH_UdmfData_GetRecords()
243 return unifiedData->records; in OH_UdmfData_GetRecords()
245 std::vector<std::shared_ptr<UnifiedRecord>> records = unifiedData->unifiedData_->GetRecords(); in OH_UdmfData_GetRecords()
246 CreateUnifiedDataRecordsArray(unifiedData, records); in OH_UdmfData_GetRecords()
247 *count = unifiedData->recordsCount; in OH_UdmfData_GetRecords()
248 return unifiedData->records; in OH_UdmfData_GetRecords()
380 int OH_Udmf_SetUnifiedData(Udmf_Intention intention, OH_UdmfData* unifiedData, char* key, unsigned … in OH_Udmf_SetUnifiedData() argument
382 if (!IsUnifiedDataValid(unifiedData) || key == nullptr || keyLen < UDMF_KEY_BUFFER_LEN) { in OH_Udmf_SetUnifiedData()
395 if ((UdmfClient::GetInstance().SetData(option, *(unifiedData->unifiedData_), keyStr)) != E_OK) { in OH_Udmf_SetUnifiedData()