1 /* 2 * Copyright (c) 2024 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 #ifndef MOCK_NETMANAGERNATIVE_PARCEL 16 #define MOCK_NETMANAGERNATIVE_PARCEL 17 18 #include <string> 19 20 namespace OHOS::NetsysNative { 21 class Parcelable; 22 class Parcel { 23 public: Parcel()24 Parcel() {} 25 virtual ~Parcel() = default; 26 27 virtual bool WriteUint32(uint32_t) = 0; 28 29 virtual bool WriteUint16(uint16_t) = 0; 30 31 virtual bool WriteBool(bool) = 0; 32 33 virtual bool WriteString(const std::string &) = 0; 34 35 virtual bool ReadUint32(uint32_t) = 0; 36 37 virtual bool ReadString(const std::string &) = 0; 38 39 virtual bool ReadUint16(uint16_t) = 0; 40 41 virtual bool ReadBool(bool) = 0; 42 }; 43 44 class Parcelable { 45 public: 46 Parcelable() = default; 47 virtual ~Parcelable() = default; 48 virtual bool Marshalling(Parcel &parcel) const = 0; 49 }; 50 } // namespace OHOS::NetsysNative 51 #endif 52