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 "MtpStringBuffer.h"
21 #include "MtpTypes.h"
22 #include "mtp.h"
23 
24 namespace android {
25 
26 class MtpDatabase;
27 
28 class MtpStorage {
29 
30 private:
31     MtpStorageID            mStorageID;
32     MtpStringBuffer         mFilePath;
33     MtpStringBuffer         mDescription;
34     uint64_t                mMaxCapacity;
35     uint64_t                mMaxFileSize;
36     bool                    mRemovable;
37 
38 public:
39                             MtpStorage(MtpStorageID id, const char* filePath,
40                                     const char* description,
41                                     bool removable, uint64_t maxFileSize);
42     virtual                 ~MtpStorage();
43 
getStorageID()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;
getPath()51     inline const char*      getPath() const { return (const char *)mFilePath; }
isRemovable()52     inline bool             isRemovable() const { return mRemovable; }
getMaxFileSize()53     inline uint64_t         getMaxFileSize() const { return mMaxFileSize; }
54 };
55 
56 }; // namespace android
57 
58 #endif // _MTP_STORAGE_H
59