1 /* 2 * Copyright (C) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "get_edit_data_vo.h" 17 18 #include <sstream> 19 #include "media_log.h" 20 #include "itypes_util.h" 21 22 namespace OHOS::Media { 23 // LCOV_EXCL_START Unmarshalling(MessageParcel & parcel)24bool GetEditDataReqBody::Unmarshalling(MessageParcel &parcel) 25 { 26 if (!DataShare::DataSharePredicates::Unmarshal(this->predicates, parcel)) { 27 return false; 28 } 29 return true; 30 } 31 Marshalling(MessageParcel & parcel) const32bool GetEditDataReqBody::Marshalling(MessageParcel &parcel) const 33 { 34 if (!DataShare::DataSharePredicates::Marshal(this->predicates, parcel)) { 35 return false; 36 } 37 return true; 38 } 39 40 ToString() const41std::string GetEditDataReqBody::ToString() const 42 { 43 std::stringstream ss; 44 // todo: add the content of GetAssetsReqBody 45 return ss.str(); 46 } 47 Unmarshalling(MessageParcel & parcel)48bool GetEditDataRespBody::Unmarshalling(MessageParcel &parcel) 49 { 50 this->resultSet = DataShare::DataShareResultSet::Unmarshal(parcel); 51 if (this->resultSet == nullptr) { 52 MEDIA_ERR_LOG("GetEditDataRespBody ReadFromParcel failed"); 53 return false; 54 } 55 MEDIA_INFO_LOG("GetEditDataRespBody ReadFromParcel success"); 56 return true; 57 } 58 Marshalling(MessageParcel & parcel) const59bool GetEditDataRespBody::Marshalling(MessageParcel &parcel) const 60 { 61 if (this->resultSet == nullptr || !DataShare::DataShareResultSet::Marshal(this->resultSet, parcel)) { 62 MEDIA_ERR_LOG("GetEditDataRespBody Marshalling failed"); 63 return false; 64 } 65 MEDIA_INFO_LOG("GetEditDataRespBody Marshalling success"); 66 return true; 67 } 68 ToString() const69std::string GetEditDataRespBody::ToString() const 70 { 71 std::stringstream ss; 72 // todo: add the content of GetAssetsRespBody 73 return ss.str(); 74 } 75 // LCOV_EXCL_STOP 76 };