blob: d6ad25f33abb540d837c9b7ba5a980c1bb086ae4 [file] [log] [blame]
Mike Lockwood56118b52010-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 Lockwood467ca0d2011-02-18 09:07:14 -050020#include "MtpTypes.h"
Mike Lockwood56118b52010-05-11 17:16:59 -040021#include "mtp.h"
22
Mike Lockwood8d3257a2010-05-14 10:10:36 -040023namespace android {
24
Mike Lockwood56118b52010-05-11 17:16:59 -040025class MtpDatabase;
Mike Lockwood56118b52010-05-11 17:16:59 -040026
27class MtpStorage {
28
29private:
30 MtpStorageID mStorageID;
Mike Lockwood467ca0d2011-02-18 09:07:14 -050031 MtpString mFilePath;
Mike Lockwoodb239b6832011-04-05 10:21:27 -040032 MtpString mDescription;
Mike Lockwood56118b52010-05-11 17:16:59 -040033 uint64_t mMaxCapacity;
Mike Lockwood7f36b192010-12-12 12:17:43 -080034 // amount of free space to leave unallocated
35 uint64_t mReserveSpace;
Mike Lockwood56118b52010-05-11 17:16:59 -040036
37public:
Mike Lockwood7f36b192010-12-12 12:17:43 -080038 MtpStorage(MtpStorageID id, const char* filePath,
Mike Lockwoodb239b6832011-04-05 10:21:27 -040039 const char* description, uint64_t reserveSpace);
Mike Lockwood56118b52010-05-11 17:16:59 -040040 virtual ~MtpStorage();
41
42 inline MtpStorageID getStorageID() const { return mStorageID; }
43 int getType() const;
44 int getFileSystemType() const;
45 int getAccessCapability() const;
46 uint64_t getMaxCapacity();
47 uint64_t getFreeSpace();
48 const char* getDescription() const;
Mike Lockwood467ca0d2011-02-18 09:07:14 -050049 inline const char* getPath() const { return (const char *)mFilePath; }
Mike Lockwood56118b52010-05-11 17:16:59 -040050};
51
Mike Lockwood8d3257a2010-05-14 10:10:36 -040052}; // namespace android
53
Mike Lockwood56118b52010-05-11 17:16:59 -040054#endif // _MTP_STORAGE_H