blob: ab8762b3adba2e1dbfabfd12c6717973e94e8d07 [file] [log] [blame]
Mike Lockwood5fd1ff02010-07-26 20:44:42 -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_FILE_H
18#define _MTP_FILE_H
19
20#include "MtpTypes.h"
21
22namespace android {
23
24class MtpClient;
25class MtpDevice;
26class MtpObjectInfo;
27
28// File-like abstraction for the interactive shell.
29// This can be used to represent an MTP device, storage unit or object
30// (either file or association).
31class MtpFile {
32private:
33 MtpDevice* mDevice;
34 MtpStorageID mStorage;
35 MtpObjectHandle mHandle;
36 static MtpClient* sClient;
37
38public:
39 MtpFile(MtpDevice* device);
40 MtpFile(MtpDevice* device, MtpStorageID storage);
41 MtpFile(MtpDevice* device, MtpStorageID storage, MtpObjectHandle handle);
42 MtpFile(MtpFile* file);
43 virtual ~MtpFile();
44
45 MtpObjectInfo* getObjectInfo();
46 void print();
47 void list();
48
49 inline MtpDevice* getDevice() const { return mDevice; }
50
51 static void init(MtpClient* client);
52 static MtpFile* parsePath(MtpFile* base, char* path);
53};
54
55}
56
57#endif // _MTP_DIRECTORY_H