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
23namespace android {
24
25class MtpDatabase;
26
27class MtpStorage {
28
29private:
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
39public:
40                            MtpStorage(MtpStorageID id, const char* filePath,
41                                    const char* description, uint64_t reserveSpace,
42                                    bool removable, uint64_t maxFileSize);
43    virtual                 ~MtpStorage();
44
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;
52    inline const char*      getPath() const { return (const char *)mFilePath; }
53    inline bool             isRemovable() const { return mRemovable; }
54    inline uint64_t         getMaxFileSize() const { return mMaxFileSize; }
55};
56
57}; // namespace android
58
59#endif // _MTP_STORAGE_H
60