Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef _MTP_STORAGE_H |
| 18 | #define _MTP_STORAGE_H |
| 19 | |
Jerry Zhang | bc1d4b4 | 2018-03-27 15:25:03 -0700 | [diff] [blame] | 20 | #include "MtpStringBuffer.h" |
Mike Lockwood | a849440 | 2011-02-18 09:07:14 -0500 | [diff] [blame] | 21 | #include "MtpTypes.h" |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 22 | #include "mtp.h" |
| 23 | |
Mike Lockwood | 7850ef9 | 2010-05-14 10:10:36 -0400 | [diff] [blame] | 24 | namespace android { |
| 25 | |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 26 | class MtpDatabase; |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 27 | |
| 28 | class MtpStorage { |
| 29 | |
| 30 | private: |
| 31 | MtpStorageID mStorageID; |
Jerry Zhang | bc1d4b4 | 2018-03-27 15:25:03 -0700 | [diff] [blame] | 32 | MtpStringBuffer mFilePath; |
| 33 | MtpStringBuffer mDescription; |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 34 | uint64_t mMaxCapacity; |
Mike Lockwood | 9b88b72 | 2011-07-11 09:18:03 -0400 | [diff] [blame] | 35 | uint64_t mMaxFileSize; |
Mike Lockwood | 7efab42 | 2011-05-09 20:16:05 -0700 | [diff] [blame] | 36 | bool mRemovable; |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 37 | |
| 38 | public: |
Mike Lockwood | 20c3be0 | 2010-12-12 12:17:43 -0800 | [diff] [blame] | 39 | MtpStorage(MtpStorageID id, const char* filePath, |
Jerry Zhang | e5aa05d | 2017-10-13 12:14:42 -0700 | [diff] [blame] | 40 | const char* description, |
Mike Lockwood | 9b88b72 | 2011-07-11 09:18:03 -0400 | [diff] [blame] | 41 | bool removable, uint64_t maxFileSize); |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 42 | virtual ~MtpStorage(); |
| 43 | |
| 44 | inline MtpStorageID getStorageID() const { return mStorageID; } |
| 45 | int getType() const; |
| 46 | int getFileSystemType() const; |
| 47 | int getAccessCapability() const; |
| 48 | uint64_t getMaxCapacity(); |
| 49 | uint64_t getFreeSpace(); |
| 50 | const char* getDescription() const; |
Mike Lockwood | a849440 | 2011-02-18 09:07:14 -0500 | [diff] [blame] | 51 | inline const char* getPath() const { return (const char *)mFilePath; } |
Mike Lockwood | 7efab42 | 2011-05-09 20:16:05 -0700 | [diff] [blame] | 52 | inline bool isRemovable() const { return mRemovable; } |
Mike Lockwood | 9b88b72 | 2011-07-11 09:18:03 -0400 | [diff] [blame] | 53 | inline uint64_t getMaxFileSize() const { return mMaxFileSize; } |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 54 | }; |
| 55 | |
Mike Lockwood | 7850ef9 | 2010-05-14 10:10:36 -0400 | [diff] [blame] | 56 | }; // namespace android |
| 57 | |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 58 | #endif // _MTP_STORAGE_H |