• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "request_edit_data_vo.h"
17 #include <sstream>
18 #include "media_log.h"
19 #include "itypes_util.h"
20 
21 namespace OHOS::Media {
22 // LCOV_EXCL_START
Unmarshalling(MessageParcel & parcel)23 bool RequestEditDataReqBody::Unmarshalling(MessageParcel &parcel)
24 {
25     if (!DataShare::DataSharePredicates::Unmarshal(this->predicates, parcel)) {
26         return false;
27     }
28     return true;
29 }
30 
Marshalling(MessageParcel & parcel) const31 bool RequestEditDataReqBody::Marshalling(MessageParcel &parcel) const
32 {
33     if (!DataShare::DataSharePredicates::Marshal(this->predicates, parcel)) {
34         return false;
35     }
36     return true;
37 }
38 
39 
ToString() const40 std::string RequestEditDataReqBody::ToString() const
41 {
42     std::stringstream ss;
43     // todo: add the content of GetAssetsReqBody
44     return ss.str();
45 }
46 
Unmarshalling(MessageParcel & parcel)47 bool RequestEditDataRespBody::Unmarshalling(MessageParcel &parcel)
48 {
49     this->resultSet = DataShare::DataShareResultSet::Unmarshal(parcel);
50     if (this->resultSet == nullptr) {
51         MEDIA_ERR_LOG("RequestEditDataRespBody ReadFromParcel failed");
52         return false;
53     }
54     MEDIA_INFO_LOG("RequestEditDataRespBody ReadFromParcel success");
55     return true;
56 }
57 
Marshalling(MessageParcel & parcel) const58 bool RequestEditDataRespBody::Marshalling(MessageParcel &parcel) const
59 {
60     if (this->resultSet == nullptr || !DataShare::DataShareResultSet::Marshal(this->resultSet, parcel)) {
61         MEDIA_ERR_LOG("RequestEditDataRespBody Marshalling failed");
62         return false;
63     }
64     MEDIA_INFO_LOG("RequestEditDataRespBody Marshalling success");
65     return true;
66 }
67 
ToString() const68 std::string RequestEditDataRespBody::ToString() const
69 {
70     std::stringstream ss;
71     // todo: add the content of GetAssetsRespBody
72     return ss.str();
73 }
74 // LCOV_EXCL_STOP
75 };