blob: e9518dd64cdecb9a5f24fecbb8f3c09963548268 [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
Jerry Zhangbc1d4b42018-03-27 15:25:03 -070020#include "MtpStringBuffer.h"
Mike Lockwooda8494402011-02-18 09:07:14 -050021#include "MtpTypes.h"
Mike Lockwood16864ba2010-05-11 17:16:59 -040022#include "mtp.h"
23
Mike Lockwood7850ef92010-05-14 10:10:36 -040024namespace android {
25
Mike Lockwood16864ba2010-05-11 17:16:59 -040026class MtpDatabase;
Mike Lockwood16864ba2010-05-11 17:16:59 -040027
28class MtpStorage {
29
30private:
31 MtpStorageID mStorageID;
Jerry Zhangbc1d4b42018-03-27 15:25:03 -070032 MtpStringBuffer mFilePath;
33 MtpStringBuffer mDescription;
Mike Lockwood16864ba2010-05-11 17:16:59 -040034 uint64_t mMaxCapacity;
Mike Lockwood9b88b722011-07-11 09:18:03 -040035 uint64_t mMaxFileSize;
Mike Lockwood7efab422011-05-09 20:16:05 -070036 bool mRemovable;
Mike Lockwood16864ba2010-05-11 17:16:59 -040037
38public:
Mike Lockwood20c3be02010-12-12 12:17:43 -080039 MtpStorage(MtpStorageID id, const char* filePath,
Jerry Zhange5aa05d2017-10-13 12:14:42 -070040 const char* description,
Mike Lockwood9b88b722011-07-11 09:18:03 -040041 bool removable, uint64_t maxFileSize);
Mike Lockwood16864ba2010-05-11 17:16:59 -040042 virtual ~MtpStorage();
43
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;
Mike Lockwooda8494402011-02-18 09:07:14 -050051 inline const char* getPath() const { return (const char *)mFilePath; }
Mike Lockwood7efab422011-05-09 20:16:05 -070052 inline bool isRemovable() const { return mRemovable; }
Mike Lockwood9b88b722011-07-11 09:18:03 -040053 inline uint64_t getMaxFileSize() const { return mMaxFileSize; }
Mike Lockwood16864ba2010-05-11 17:16:59 -040054};
55
Mike Lockwood7850ef92010-05-14 10:10:36 -040056}; // namespace android
57
Mike Lockwood16864ba2010-05-11 17:16:59 -040058#endif // _MTP_STORAGE_H