1 /*
2  * Copyright (c) 2023 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 #ifndef UDMF_TYPES_UTIL_H
17 #define UDMF_TYPES_UTIL_H
18 #include "visibility.h"
19 #include "itypes_util.h"
20 
21 #include "unified_data.h"
22 #include "unified_meta.h"
23 #include "unified_types.h"
24 
25 namespace OHOS {
26 namespace ITypesUtil {
27 using UnifiedData = UDMF::UnifiedData;
28 using Summary = UDMF::Summary;
29 using Privilege = UDMF::Privilege;
30 using CustomOption = UDMF::CustomOption;
31 using QueryOption = UDMF::QueryOption;
32 using UDType = UDMF::UDType;
33 using Intention = UDMF::Intention;
34 
35 template<>
36 bool API_EXPORT Marshalling(const UnifiedData &input, MessageParcel &parcel);
37 template<>
38 bool API_EXPORT Unmarshalling(UnifiedData &output, MessageParcel &parcel);
39 
40 template<>
41 bool API_EXPORT Marshalling(const std::vector<UnifiedData> &input, MessageParcel &parcel);
42 template<>
43 bool API_EXPORT Unmarshalling(std::vector<UnifiedData> &output, MessageParcel &parcel);
44 
45 template<>
46 bool API_EXPORT Marshalling(const Summary &input, MessageParcel &parcel);
47 template<>
48 bool API_EXPORT Unmarshalling(Summary &output, MessageParcel &parcel);
49 
50 template<>
51 bool API_EXPORT Marshalling(const Privilege &input, MessageParcel &parcel);
52 template<>
53 bool API_EXPORT Unmarshalling(Privilege &output, MessageParcel &parcel);
54 
55 template<>
56 bool API_EXPORT Marshalling(const CustomOption &input, MessageParcel &parcel);
57 template<>
58 bool API_EXPORT Unmarshalling(CustomOption &output, MessageParcel &parcel);
59 
60 template<>
61 bool API_EXPORT Marshalling(const QueryOption &input, MessageParcel &parcel);
62 template<>
63 bool API_EXPORT Unmarshalling(QueryOption &output, MessageParcel &parcel);
64 
65 template<>
66 bool API_EXPORT Marshalling(const UDType &input, MessageParcel &parcel);
67 template<>
68 bool API_EXPORT Unmarshalling(UDType &output, MessageParcel &parcel);
69 
70 template<>
71 bool API_EXPORT Marshalling(const Intention &input, MessageParcel &parcel);
72 template<>
73 bool API_EXPORT Unmarshalling(Intention &output, MessageParcel &parcel);
74 } // namespace ITypesUtil
75 } // namespace OHOS
76 #endif // UDMF_TYPES_UTIL_H