• 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 "start_asset_analysis_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)24 bool StartAssetAnalysisReqBody::Unmarshalling(MessageParcel &parcel)
25 {
26     if (!DataShare::DataSharePredicates::Unmarshal(this->predicates, parcel)) {
27         return false;
28     }
29     return parcel.ReadString(this->uri);
30 }
31 
Marshalling(MessageParcel & parcel) const32 bool StartAssetAnalysisReqBody::Marshalling(MessageParcel &parcel) const
33 {
34     if (!DataShare::DataSharePredicates::Marshal(this->predicates, parcel)) {
35         return false;
36     }
37     return parcel.WriteString(this->uri);
38 }
39 
40 
ToString() const41 std::string StartAssetAnalysisReqBody::ToString() const
42 {
43     std::stringstream ss;
44     // todo: add the content of GetAssetsReqBody
45     return ss.str();
46 }
47 
Unmarshalling(MessageParcel & parcel)48 bool StartAssetAnalysisRespBody::Unmarshalling(MessageParcel &parcel)
49 {
50     this->resultSet = DataShare::DataShareResultSet::Unmarshal(parcel);
51     if (this->resultSet == nullptr) {
52         MEDIA_ERR_LOG("StartAssetAnalysisRespBody ReadFromParcel failed");
53         return false;
54     }
55     MEDIA_INFO_LOG("StartAssetAnalysisRespBody ReadFromParcel success");
56     return true;
57 }
58 
Marshalling(MessageParcel & parcel) const59 bool StartAssetAnalysisRespBody::Marshalling(MessageParcel &parcel) const
60 {
61     if (this->resultSet == nullptr || !DataShare::DataShareResultSet::Marshal(this->resultSet, parcel)) {
62         MEDIA_ERR_LOG("StartAssetAnalysisRespBody Marshalling failed");
63         return false;
64     }
65     MEDIA_INFO_LOG("StartAssetAnalysisRespBody Marshalling success");
66     return true;
67 }
68 
ToString() const69 std::string StartAssetAnalysisRespBody::ToString() const
70 {
71     std::stringstream ss;
72     // todo: add the content of GetAssetsRespBody
73     return ss.str();
74 }
75 // LCOV_EXCL_STOP
76 };