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 "modify_assets_vo.h"
17
18 #include "media_itypes_utils.h"
19 #include "media_log.h"
20
21 namespace OHOS::Media {
22
Unmarshalling(MessageParcel & parcel)23 bool ModifyAssetsReqBody::Unmarshalling(MessageParcel &parcel)
24 {
25 bool status = parcel.ReadInt32(this->pending);
26 CHECK_AND_RETURN_RET(status, status);
27 status = parcel.ReadInt32(this->favorite);
28 CHECK_AND_RETURN_RET(status, status);
29 status = parcel.ReadInt32(this->hiddenStatus);
30 CHECK_AND_RETURN_RET(status, status);
31 status = parcel.ReadInt32(this->recentShowStatus);
32 CHECK_AND_RETURN_RET(status, status);
33 status = parcel.ReadString(this->title);
34 CHECK_AND_RETURN_RET(status, status);
35 status = parcel.ReadString(this->userComment);
36 CHECK_AND_RETURN_RET(status, status);
37 return IPC::ITypeMediaUtil::Unmarshalling<int32_t>(this->fileIds, parcel);
38 }
39
Marshalling(MessageParcel & parcel) const40 bool ModifyAssetsReqBody::Marshalling(MessageParcel &parcel) const
41 {
42 bool status = parcel.WriteInt32(this->pending);
43 CHECK_AND_RETURN_RET(status, status);
44 status = parcel.WriteInt32(this->favorite);
45 CHECK_AND_RETURN_RET(status, status);
46 status = parcel.WriteInt32(this->hiddenStatus);
47 CHECK_AND_RETURN_RET(status, status);
48 status = parcel.WriteInt32(this->recentShowStatus);
49 CHECK_AND_RETURN_RET(status, status);
50 status = parcel.WriteString(this->title);
51 CHECK_AND_RETURN_RET(status, status);
52 status = parcel.WriteString(this->userComment);
53 CHECK_AND_RETURN_RET(status, status);
54 return IPC::ITypeMediaUtil::Marshalling<int32_t>(this->fileIds, parcel);
55 }
56 } // namespace OHOS::Media
57