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 
17 #ifndef MOCK_NATIVE_INCLUDE_PARCEL_H
18 #define MOCK_NATIVE_INCLUDE_PARCEL_H
19 
20 #include <string>
21 #include <vector>
22 #include "nocopyable.h"
23 #include "refbase.h"
24 
25 namespace OHOS {
26 class Parcel;
27 
28 class Parcelable : public virtual RefBase {
29 public:
30     virtual ~Parcelable() = default;
31 
32     Parcelable();
33     explicit Parcelable(bool asRemote);
34 };
35 
36 class Parcel {
37 public:
38     Parcel();
39 
40     ~Parcel();
41 
42     size_t GetDataCapacity() const;
43 
44     bool SetDataCapacity(size_t newCapacity);
45 
46     bool WriteInt32(int32_t value);
47 
48     int32_t ReadInt32();
49 
50     uint32_t ReadUint32();
51 
52     bool ReadInt32(int32_t &value);
53 
54     const uint8_t *ReadBuffer(size_t length);
55 };
56 } // namespace OHOS
57 #endif // MOCK_NATIVE_INCLUDE_PARCEL_H
58