Lines Matching refs:properties

144 static bool IsUnifiedPropertiesValid(OH_UdmfProperty* properties)

146 return properties != nullptr && properties->properties_ != nullptr &&
147 properties->cid == NdkStructId::UDMF_UNIFIED_DATA_PROPERTIES_ID;
724 OH_UdmfProperty* properties = new (std::nothrow) OH_UdmfProperty;
725 if (properties == nullptr) {
728 properties->properties_ = data->unifiedData_->GetProperties();
729 return properties;
732 void OH_UdmfProperty_Destroy(OH_UdmfProperty* properties)
734 if (properties != nullptr) {
735 delete properties;
739 const char* OH_UdmfProperty_GetTag(OH_UdmfProperty* properties)
741 if (!IsUnifiedPropertiesValid(properties)) {
744 return properties->properties_->tag.c_str();
747 int64_t OH_UdmfProperty_GetTimestamp(OH_UdmfProperty* properties)
749 if (!IsUnifiedPropertiesValid(properties)) {
752 return properties->properties_->timestamp;
755 Udmf_ShareOption OH_UdmfProperty_GetShareOption(OH_UdmfProperty* properties)
757 if (!IsUnifiedPropertiesValid(properties)) {
760 switch (properties->properties_->shareOptions) {
770 int OH_UdmfProperty_GetExtrasIntParam(OH_UdmfProperty* properties, const char* key, const int defaultValue)
772 return (IsUnifiedPropertiesValid(properties) && key != nullptr) ?
773 properties->properties_->extras.GetIntParam(key, defaultValue) : defaultValue;
776 const char* OH_UdmfProperty_GetExtrasStringParam(OH_UdmfProperty* properties, const char* key)
778 if (!IsUnifiedPropertiesValid(properties) || key == nullptr) {
781 properties->extraStr = properties->properties_->extras.GetStringParam(key);
782 return properties->extraStr.c_str();
785 int OH_UdmfProperty_SetTag(OH_UdmfProperty* properties, const char* tag)
787 if (!IsUnifiedPropertiesValid(properties) || tag == nullptr) {
790 properties->properties_->tag = tag;
794 int OH_UdmfProperty_SetShareOption(OH_UdmfProperty* properties, Udmf_ShareOption option)
796 if (!IsUnifiedPropertiesValid(properties)) {
799 std::lock_guard<std::mutex> lock(properties->mutex);
802 properties->properties_->shareOptions = ShareOptions::IN_APP;
805 properties->properties_->shareOptions = ShareOptions::CROSS_APP;
813 int OH_UdmfProperty_SetExtrasIntParam(OH_UdmfProperty* properties, const char* key, int param)
815 if (!IsUnifiedPropertiesValid(properties) || key == nullptr) {
818 std::lock_guard<std::mutex> lock(properties->mutex);
819 properties->properties_->extras.SetParam(key, OHOS::AAFwk::Integer::Box(param));
823 int OH_UdmfProperty_SetExtrasStringParam(OH_UdmfProperty* properties, const char* key, const char* param)
825 if (!IsUnifiedPropertiesValid(properties) || key == nullptr || param == nullptr) {
828 std::lock_guard<std::mutex> lock(properties->mutex);
829 properties->properties_->extras.SetParam(key, OHOS::AAFwk::String::Box(param));