Tom Marshall | 292bd23 | 2019-01-04 14:37:31 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 Cyanogen, Inc. |
| 3 | * Copyright (C) 2019 The LineageOS Project |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | #ifndef ANDROID_VOLMGR_DISKPARTITION_H |
| 19 | #define ANDROID_VOLMGR_DISKPARTITION_H |
| 20 | |
| 21 | #include "Disk.h" |
| 22 | |
| 23 | namespace android { |
| 24 | namespace volmgr { |
| 25 | |
| 26 | /* |
| 27 | * Representation of a single partition on physical media. Useful for |
| 28 | * single media partitions such as "internal" sdcard partitions. |
| 29 | */ |
| 30 | |
| 31 | class DiskPartition : public Disk { |
| 32 | public: |
| 33 | DiskPartition(const std::string& eventPath, dev_t device, const std::string& nickname, int flags, |
| 34 | int partnum, const std::string& fstype = "", const std::string& mntopts = ""); |
| 35 | virtual ~DiskPartition(); |
| 36 | |
| 37 | virtual status_t create(); |
| 38 | virtual status_t destroy(); |
| 39 | |
| 40 | private: |
| 41 | /* Partition number */ |
| 42 | int mPartNum; |
| 43 | /* Filesystem type */ |
| 44 | std::string mFsType; |
| 45 | /* Mount options */ |
| 46 | std::string mMntOpts; |
| 47 | }; |
| 48 | |
| 49 | } // namespace volmgr |
| 50 | } // namespace android |
| 51 | |
| 52 | #endif |