blob: e5a2e5746a84774f128b8183ff23c66c2b0253cd [file] [log] [blame]
Mike Lockwood16864ba2010-05-11 17:16:59 -04001/*
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 Lockwooda8494402011-02-18 09:07:14 -050020#include "MtpTypes.h"
Mike Lockwood16864ba2010-05-11 17:16:59 -040021#include "mtp.h"
22
Mike Lockwood7850ef92010-05-14 10:10:36 -040023namespace android {
24
Mike Lockwood16864ba2010-05-11 17:16:59 -040025class MtpDatabase;
Mike Lockwood16864ba2010-05-11 17:16:59 -040026
27class MtpStorage {
28
29private:
30 MtpStorageID mStorageID;
Mike Lockwooda8494402011-02-18 09:07:14 -050031 MtpString mFilePath;
Mike Lockwood0241cac2011-04-05 10:21:27 -040032 MtpString mDescription;
Mike Lockwood16864ba2010-05-11 17:16:59 -040033 uint64_t mMaxCapacity;
Mike Lockwood9b88b722011-07-11 09:18:03 -040034 uint64_t mMaxFileSize;
Mike Lockwood20c3be02010-12-12 12:17:43 -080035 // amount of free space to leave unallocated
36 uint64_t mReserveSpace;
Mike Lockwood7efab422011-05-09 20:16:05 -070037 bool mRemovable;
Mike Lockwood16864ba2010-05-11 17:16:59 -040038
39public:
Mike Lockwood20c3be02010-12-12 12:17:43 -080040 MtpStorage(MtpStorageID id, const char* filePath,
Mike Lockwood7efab422011-05-09 20:16:05 -070041 const char* description, uint64_t reserveSpace,
Mike Lockwood9b88b722011-07-11 09:18:03 -040042 bool removable, uint64_t maxFileSize);
Mike Lockwood16864ba2010-05-11 17:16:59 -040043 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;
Mike Lockwooda8494402011-02-18 09:07:14 -050052 inline const char* getPath() const { return (const char *)mFilePath; }
Mike Lockwood7efab422011-05-09 20:16:05 -070053 inline bool isRemovable() const { return mRemovable; }
Mike Lockwood9b88b722011-07-11 09:18:03 -040054 inline uint64_t getMaxFileSize() const { return mMaxFileSize; }
Mike Lockwood16864ba2010-05-11 17:16:59 -040055};
56
Mike Lockwood7850ef92010-05-14 10:10:36 -040057}; // namespace android
58
Mike Lockwood16864ba2010-05-11 17:16:59 -040059#endif // _MTP_STORAGE_H