• 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"){return 0;}
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_asset_analysis_data_vo.h"
17 
18 #include "media_log.h"
19 
20 namespace OHOS::Media {
21 
Unmarshalling(MessageParcel & parcel)22 bool GetAssetAnalysisDataReqBody::Unmarshalling(MessageParcel &parcel)
23 {
24     bool status = parcel.ReadInt32(this->fileId);
25     CHECK_AND_RETURN_RET_LOG(status, status, "Read fileId failed");
26     status = parcel.ReadInt32(this->analysisType);
27     CHECK_AND_RETURN_RET_LOG(status, status, "Read analysisType failed");
28     status = parcel.ReadString(this->language);
29     CHECK_AND_RETURN_RET_LOG(status, status, "Read language failed");
30     return parcel.ReadBool(this->analysisTotal);
31 }
32 
Marshalling(MessageParcel & parcel) const33 bool GetAssetAnalysisDataReqBody::Marshalling(MessageParcel &parcel) const
34 {
35     bool status = parcel.WriteInt32(this->fileId);
36     CHECK_AND_RETURN_RET_LOG(status, status, "Write fileId failed");
37     status = parcel.WriteInt32(this->analysisType);
38     CHECK_AND_RETURN_RET_LOG(status, status, "Write analysisType failed");
39     status = parcel.WriteString(this->language);
40     CHECK_AND_RETURN_RET_LOG(status, status, "Write language failed");
41     return parcel.WriteBool(this->analysisTotal);
42 }
43 
Unmarshalling(MessageParcel & parcel)44 bool GetAssetAnalysisDataRespBody::Unmarshalling(MessageParcel &parcel)
45 {
46     this->resultSet = DataShare::DataShareResultSet::Unmarshal(parcel);
47     CHECK_AND_RETURN_RET_LOG(this->resultSet != nullptr, false, "resultSet nullptr");
48     return true;
49 }
50 
Marshalling(MessageParcel & parcel) const51 bool GetAssetAnalysisDataRespBody::Marshalling(MessageParcel &parcel) const
52 {
53     CHECK_AND_RETURN_RET_LOG(this->resultSet != nullptr, false, "resultSet nullptr");
54     return DataShare::DataShareResultSet::Marshal(this->resultSet, parcel);
55 }
56 } // namespace OHOS::Media