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 | |
Mike Lockwood | a849440 | 2011-02-18 09:07:14 -0500 | [diff] [blame] | 20 | #include "MtpTypes.h" |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 21 | #include "mtp.h" |
| 22 | |
Mike Lockwood | 7850ef9 | 2010-05-14 10:10:36 -0400 | [diff] [blame] | 23 | namespace android { |
| 24 | |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 25 | class MtpDatabase; |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 26 | |
| 27 | class MtpStorage { |
| 28 | |
| 29 | private: |
| 30 | MtpStorageID mStorageID; |
Mike Lockwood | a849440 | 2011-02-18 09:07:14 -0500 | [diff] [blame] | 31 | MtpString mFilePath; |
Mike Lockwood | 0241cac | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 32 | MtpString mDescription; |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 33 | uint64_t mMaxCapacity; |
Mike Lockwood | 9b88b72 | 2011-07-11 09:18:03 -0400 | [diff] [blame] | 34 | uint64_t mMaxFileSize; |
Mike Lockwood | 7efab42 | 2011-05-09 20:16:05 -0700 | [diff] [blame] | 35 | bool mRemovable; |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 36 | |
| 37 | public: |
Mike Lockwood | 20c3be0 | 2010-12-12 12:17:43 -0800 | [diff] [blame] | 38 | MtpStorage(MtpStorageID id, const char* filePath, |
Jerry Zhang | e5aa05d | 2017-10-13 12:14:42 -0700 | [diff] [blame] | 39 | const char* description, |
Mike Lockwood | 9b88b72 | 2011-07-11 09:18:03 -0400 | [diff] [blame] | 40 | bool removable, uint64_t maxFileSize); |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 41 | virtual ~MtpStorage(); |
| 42 | |
| 43 | inline MtpStorageID getStorageID() const { return mStorageID; } |
| 44 | int getType() const; |
| 45 | int getFileSystemType() const; |
| 46 | int getAccessCapability() const; |
| 47 | uint64_t getMaxCapacity(); |
| 48 | uint64_t getFreeSpace(); |
| 49 | const char* getDescription() const; |
Mike Lockwood | a849440 | 2011-02-18 09:07:14 -0500 | [diff] [blame] | 50 | inline const char* getPath() const { return (const char *)mFilePath; } |
Mike Lockwood | 7efab42 | 2011-05-09 20:16:05 -0700 | [diff] [blame] | 51 | inline bool isRemovable() const { return mRemovable; } |
Mike Lockwood | 9b88b72 | 2011-07-11 09:18:03 -0400 | [diff] [blame] | 52 | inline uint64_t getMaxFileSize() const { return mMaxFileSize; } |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 53 | }; |
| 54 | |
Mike Lockwood | 7850ef9 | 2010-05-14 10:10:36 -0400 | [diff] [blame] | 55 | }; // namespace android |
| 56 | |
Mike Lockwood | 16864ba | 2010-05-11 17:16:59 -0400 | [diff] [blame] | 57 | #endif // _MTP_STORAGE_H |