blob: 011cb81c445544d9409a1cf45e9949fc5e2f19ed [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
20#include "mtp.h"
21
22class MtpDatabase;
23class SqliteStatement;
24
25class MtpStorage {
26
27private:
28 MtpStorageID mStorageID;
29 const char* mFilePath;
30 MtpDatabase* mDatabase;
31 uint64_t mMaxCapacity;
32
33public:
34 MtpStorage(MtpStorageID id, const char* filePath, MtpDatabase* db);
35 virtual ~MtpStorage();
36
37 inline MtpStorageID getStorageID() const { return mStorageID; }
38 int getType() const;
39 int getFileSystemType() const;
40 int getAccessCapability() const;
41 uint64_t getMaxCapacity();
42 uint64_t getFreeSpace();
43 const char* getDescription() const;
44 inline const char* getPath() const { return mFilePath; }
45
46 bool scanFiles();
47
48private:
49 int scanDirectory(const char* path, MtpObjectHandle parent);
50};
51
52#endif // _MTP_STORAGE_H