• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
20 #include "MtpTypes.h"
21 #include "mtp.h"
22 
23 namespace android {
24 
25 class MtpDatabase;
26 
27 class MtpStorage {
28 
29 private:
30     MtpStorageID            mStorageID;
31     MtpString               mFilePath;
32     MtpString               mDescription;
33     uint64_t                mMaxCapacity;
34     uint64_t                mMaxFileSize;
35     // amount of free space to leave unallocated
36     uint64_t                mReserveSpace;
37     bool                    mRemovable;
38 
39 public:
40                             MtpStorage(MtpStorageID id, const char* filePath,
41                                     const char* description, uint64_t reserveSpace,
42                                     bool removable, uint64_t maxFileSize);
43     virtual                 ~MtpStorage();
44 
getStorageID()45     inline MtpStorageID     getStorageID() const { return mStorageID; }
46     int                     getType() const;
47     int                     getFileSystemType() const;
48     int                     getAccessCapability() const;
49     uint64_t                getMaxCapacity();
50     uint64_t                getFreeSpace();
51     const char*             getDescription() const;
getPath()52     inline const char*      getPath() const { return (const char *)mFilePath; }
isRemovable()53     inline bool             isRemovable() const { return mRemovable; }
getMaxFileSize()54     inline uint64_t         getMaxFileSize() const { return mMaxFileSize; }
55 };
56 
57 }; // namespace android
58 
59 #endif // _MTP_STORAGE_H
60