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 OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_TYPES_UTIL_H 17 #define OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_TYPES_UTIL_H 18 #include "itypes_util.h" 19 #include "cloud_types.h" 20 #include "values_bucket.h" 21 #include "common_types.h" 22 23 namespace OHOS::ITypesUtil { 24 using Participant = OHOS::CloudData::Participant; 25 using Privilege = OHOS::CloudData::Privilege; 26 using Role = OHOS::CloudData::Role; 27 using Confirmation = OHOS::CloudData::Confirmation; 28 using SharingCode = OHOS::CloudData::SharingCode; 29 using Asset = OHOS::NativeRdb::AssetValue; 30 using ValueObject = OHOS::NativeRdb::ValueObject; 31 using ValuesBucket = OHOS::NativeRdb::ValuesBucket; 32 using StatisticInfo = OHOS::CloudData::StatisticInfo; 33 using CommonAsset = CommonType::Asset; 34 using Strategy = OHOS::CloudData::Strategy; 35 using CloudSyncInfo = OHOS::CloudData::CloudSyncInfo; 36 37 template<> 38 bool Marshalling(const Participant &input, MessageParcel &data); 39 template<> 40 bool Unmarshalling(Participant &output, MessageParcel &data); 41 42 template<> 43 bool Marshalling(const Privilege &input, MessageParcel &data); 44 template<> 45 bool Unmarshalling(Privilege &output, MessageParcel &data); 46 47 template<> 48 bool Marshalling(const Role &input, MessageParcel &data); 49 template<> 50 bool Unmarshalling(Role &output, MessageParcel &data); 51 52 template<> 53 bool Marshalling(const Confirmation &input, MessageParcel &data); 54 template<> 55 bool Unmarshalling(Confirmation &output, MessageParcel &data); 56 57 template<> 58 bool Marshalling(const SharingCode &input, MessageParcel &data); 59 template<> 60 bool Unmarshalling(SharingCode &output, MessageParcel &data); 61 62 template<> 63 bool Marshalling(const Asset &input, MessageParcel &data); 64 template<> 65 bool Unmarshalling(Asset &output, MessageParcel &data); 66 template<> 67 bool Marshalling(const ValueObject &input, MessageParcel &data); 68 template<> 69 bool Unmarshalling(ValueObject &output, MessageParcel &data); 70 template<> 71 bool Marshalling(const ValuesBucket &input, MessageParcel &data); 72 template<> 73 bool Unmarshalling(ValuesBucket &output, MessageParcel &data); 74 75 template<> 76 bool Unmarshalling(StatisticInfo &output, MessageParcel &data); 77 78 template<> 79 bool Marshalling(const Strategy &input, MessageParcel &data); 80 81 template<> 82 bool Marshalling(const CommonAsset &input, MessageParcel &data); 83 84 template<> 85 bool Marshalling(const CloudSyncInfo &input, MessageParcel &data); 86 template<> 87 bool Unmarshalling(CloudSyncInfo &output, MessageParcel &data); 88 } // namespace OHOS::ITypesUtil 89 #endif // OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_TYPES_UTIL_H