1cb7eb8c9Sopenharmony_ci/* 2cb7eb8c9Sopenharmony_ci * Copyright (C) 2024 Huawei Device Co., Ltd. 3cb7eb8c9Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4cb7eb8c9Sopenharmony_ci * you may not use this file except in compliance with the License. 5cb7eb8c9Sopenharmony_ci * You may obtain a copy of the License at 6cb7eb8c9Sopenharmony_ci * 7cb7eb8c9Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8cb7eb8c9Sopenharmony_ci * 9cb7eb8c9Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10cb7eb8c9Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11cb7eb8c9Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12cb7eb8c9Sopenharmony_ci * See the License for the specific language governing permissions and 13cb7eb8c9Sopenharmony_ci * limitations under the License. 14cb7eb8c9Sopenharmony_ci */ 15cb7eb8c9Sopenharmony_ci#include "iremote_broker.h" 16cb7eb8c9Sopenharmony_ci#include "message_parcel_mock.h" 17cb7eb8c9Sopenharmony_ci 18cb7eb8c9Sopenharmony_cinamespace OHOS { 19cb7eb8c9Sopenharmony_ciusing namespace OHOS::Storage::DistributedFile; 20cb7eb8c9Sopenharmony_ci 21cb7eb8c9Sopenharmony_ciParcelable::Parcelable() : Parcelable(false) 22cb7eb8c9Sopenharmony_ci{} 23cb7eb8c9Sopenharmony_ci 24cb7eb8c9Sopenharmony_ciParcelable::Parcelable(bool asRemote) 25cb7eb8c9Sopenharmony_ci{ 26cb7eb8c9Sopenharmony_ci asRemote_ = asRemote; 27cb7eb8c9Sopenharmony_ci behavior_ = 0; 28cb7eb8c9Sopenharmony_ci} 29cb7eb8c9Sopenharmony_ci 30cb7eb8c9Sopenharmony_cibool MessageParcel::WriteInterfaceToken(std::u16string name) 31cb7eb8c9Sopenharmony_ci{ 32cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->WriteInterfaceToken(name); 33cb7eb8c9Sopenharmony_ci} 34cb7eb8c9Sopenharmony_ci 35cb7eb8c9Sopenharmony_cistd::u16string MessageParcel::ReadInterfaceToken() 36cb7eb8c9Sopenharmony_ci{ 37cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->ReadInterfaceToken(); 38cb7eb8c9Sopenharmony_ci} 39cb7eb8c9Sopenharmony_ci 40cb7eb8c9Sopenharmony_cibool Parcel::WriteParcelable(const Parcelable *object) 41cb7eb8c9Sopenharmony_ci{ 42cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->WriteParcelable(object); 43cb7eb8c9Sopenharmony_ci} 44cb7eb8c9Sopenharmony_ci 45cb7eb8c9Sopenharmony_cibool Parcel::WriteInt32(int32_t value) 46cb7eb8c9Sopenharmony_ci{ 47cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->WriteInt32(value); 48cb7eb8c9Sopenharmony_ci} 49cb7eb8c9Sopenharmony_ci 50cb7eb8c9Sopenharmony_ciint32_t Parcel::ReadInt32() 51cb7eb8c9Sopenharmony_ci{ 52cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->ReadInt32(); 53cb7eb8c9Sopenharmony_ci} 54cb7eb8c9Sopenharmony_ci 55cb7eb8c9Sopenharmony_cibool Parcel::ReadInt32(int32_t &value) 56cb7eb8c9Sopenharmony_ci{ 57cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->ReadInt32(value); 58cb7eb8c9Sopenharmony_ci} 59cb7eb8c9Sopenharmony_ci 60cb7eb8c9Sopenharmony_cibool Parcel::WriteRemoteObject(const Parcelable *object) 61cb7eb8c9Sopenharmony_ci{ 62cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->WriteRemoteObject(object); 63cb7eb8c9Sopenharmony_ci} 64cb7eb8c9Sopenharmony_ci 65cb7eb8c9Sopenharmony_cibool MessageParcel::WriteRemoteObject(const sptr<IRemoteObject> &object) 66cb7eb8c9Sopenharmony_ci{ 67cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->WriteRemoteObject(object); 68cb7eb8c9Sopenharmony_ci} 69cb7eb8c9Sopenharmony_ci 70cb7eb8c9Sopenharmony_cisptr<IRemoteObject> MessageParcel::ReadRemoteObject() 71cb7eb8c9Sopenharmony_ci{ 72cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->ReadRemoteObject(); 73cb7eb8c9Sopenharmony_ci} 74cb7eb8c9Sopenharmony_ci 75cb7eb8c9Sopenharmony_cibool Parcel::ReadBool() 76cb7eb8c9Sopenharmony_ci{ 77cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->ReadBool(); 78cb7eb8c9Sopenharmony_ci} 79cb7eb8c9Sopenharmony_ci 80cb7eb8c9Sopenharmony_cibool Parcel::ReadBool(bool &value) 81cb7eb8c9Sopenharmony_ci{ 82cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->ReadBool(value); 83cb7eb8c9Sopenharmony_ci} 84cb7eb8c9Sopenharmony_ci 85cb7eb8c9Sopenharmony_cibool Parcel::WriteBool(bool value) 86cb7eb8c9Sopenharmony_ci{ 87cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->WriteBool(value); 88cb7eb8c9Sopenharmony_ci} 89cb7eb8c9Sopenharmony_ci 90cb7eb8c9Sopenharmony_cibool Parcel::WriteString(const std::string &value) 91cb7eb8c9Sopenharmony_ci{ 92cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->WriteString(value); 93cb7eb8c9Sopenharmony_ci} 94cb7eb8c9Sopenharmony_ci 95cb7eb8c9Sopenharmony_cibool Parcel::WriteCString(const char *value) 96cb7eb8c9Sopenharmony_ci{ 97cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->WriteCString(value); 98cb7eb8c9Sopenharmony_ci} 99cb7eb8c9Sopenharmony_ci 100cb7eb8c9Sopenharmony_cibool Parcel::ReadString(std::string &value) 101cb7eb8c9Sopenharmony_ci{ 102cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->ReadString(value); 103cb7eb8c9Sopenharmony_ci} 104cb7eb8c9Sopenharmony_ci 105cb7eb8c9Sopenharmony_cibool Parcel::ReadStringVector(std::vector<std::string> *value) 106cb7eb8c9Sopenharmony_ci{ 107cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->ReadStringVector(value); 108cb7eb8c9Sopenharmony_ci} 109cb7eb8c9Sopenharmony_ci 110cb7eb8c9Sopenharmony_cibool MessageParcel::WriteFileDescriptor(int fd) 111cb7eb8c9Sopenharmony_ci{ 112cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->WriteFileDescriptor(fd); 113cb7eb8c9Sopenharmony_ci} 114cb7eb8c9Sopenharmony_ci 115cb7eb8c9Sopenharmony_ciint MessageParcel::ReadFileDescriptor() 116cb7eb8c9Sopenharmony_ci{ 117cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->ReadFileDescriptor(); 118cb7eb8c9Sopenharmony_ci} 119cb7eb8c9Sopenharmony_ci 120cb7eb8c9Sopenharmony_cibool Parcel::ReadUint32(uint32_t &value) 121cb7eb8c9Sopenharmony_ci{ 122cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->ReadUint32(value); 123cb7eb8c9Sopenharmony_ci} 124cb7eb8c9Sopenharmony_ci 125cb7eb8c9Sopenharmony_cibool Parcel::WriteUint64(uint64_t value) 126cb7eb8c9Sopenharmony_ci{ 127cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->WriteUint64(value); 128cb7eb8c9Sopenharmony_ci} 129cb7eb8c9Sopenharmony_ci 130cb7eb8c9Sopenharmony_cibool Parcel::WriteUint16(uint16_t value) 131cb7eb8c9Sopenharmony_ci{ 132cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->WriteUint16(value); 133cb7eb8c9Sopenharmony_ci} 134cb7eb8c9Sopenharmony_ci 135cb7eb8c9Sopenharmony_cibool Parcel::ReadUint64(uint64_t &value) 136cb7eb8c9Sopenharmony_ci{ 137cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->ReadUint64(value); 138cb7eb8c9Sopenharmony_ci} 139cb7eb8c9Sopenharmony_ci 140cb7eb8c9Sopenharmony_cibool Parcel::WriteStringVector(const std::vector<std::string> &val) 141cb7eb8c9Sopenharmony_ci{ 142cb7eb8c9Sopenharmony_ci return DfsMessageParcel::messageParcel->WriteStringVector(val); 143cb7eb8c9Sopenharmony_ci} 144cb7eb8c9Sopenharmony_ci} // namespace OHOS