Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 // | |
| 5 // This class manages all the information about the media transfer protocol | |
| 6 // device object entry. To support media file system operations, this | |
| 7 // class is created, destroyed and operated on the blocking thread. | |
| 8 // | |
| 9 // EXAMPLE: | |
| 10 // class MTPDeviceObjectParser { | |
| 11 // public: | |
| 12 // MTPDeviceObjectParser() { } | |
| 13 // | |
| 14 // void GetObjectNameAndSize() { | |
| 15 // MTPDeviceObjectEntry entry; | |
| 16 // bool res = MediaDeviceOperationsUtil::GetMTPDeviceObjectEntry(device, | |
| 17 // object_id_, | |
| 18 // &entry); | |
| 19 // string16 name = entry.file_name(); | |
| 20 // int16 size = entry.size(); | |
| 21 // } | |
| 22 // | |
| 23 // private: | |
| 24 // base::win::scoped_comptr<IPortableDevice*> device_; | |
| 25 // const string object_id_; | |
| 26 // }; | |
| 27 | |
| 28 #ifndef CHROME_BROWSER_MEDIA_GALLERY_WIN_MTP_DEVICE_OBJECT_ENTRY_H_ | |
| 29 #define CHROME_BROWSER_MEDIA_GALLERY_WIN_MTP_DEVICE_OBJECT_ENTRY_H_ | |
| 30 | |
| 31 #include <vector> | |
| 32 | |
| 33 #include "base/string16.h" | |
| 34 #include "base/time.h" | |
| 35 | |
| 36 namespace chrome { | |
| 37 | |
| 38 class MTPDeviceObjectEntry; | |
| 39 typedef std::vector<MTPDeviceObjectEntry> MTPDeviceObjectEntries; | |
| 40 | |
| 41 // See comment at top of file for a complete class description. | |
| 42 class MTPDeviceObjectEntry { | |
| 43 public: | |
| 44 MTPDeviceObjectEntry(); | |
| 45 MTPDeviceObjectEntry(const string16& object_id, | |
| 46 const string16& object_name, | |
| 47 bool is_directory, | |
| 48 int64 size, | |
| 49 const base::Time& last_modified_time); | |
| 50 | |
| 51 virtual ~MTPDeviceObjectEntry(); | |
|
Lei Zhang
2012/11/01 02:34:57
Does not need to be virtual.
kmadhusu
2012/11/01 17:59:00
Done.
| |
| 52 | |
| 53 // Accessor functions to get object details. | |
| 54 string16 object_id() const { return object_id_; } | |
| 55 string16 file_name() const { return name_; } | |
| 56 bool is_directory() const { return is_directory_; } | |
| 57 int64 size() const { return size_; } | |
| 58 base::Time last_modified_time() const { return last_modified_time_; } | |
| 59 | |
| 60 private: | |
| 61 // The object identifier, e.g. "o299". | |
| 62 string16 object_id_; | |
| 63 | |
| 64 // Friendly name of the object, e.g. "IMG_9911.jpeg". | |
| 65 string16 name_; | |
| 66 | |
| 67 // True, if the current object is a directory/folder/album content type. | |
| 68 bool is_directory_; | |
| 69 | |
| 70 // The object file size in bytes, e.g. "882992". | |
| 71 int64 size_; | |
| 72 | |
| 73 // Last modified time of the object. | |
| 74 base::Time last_modified_time_; | |
| 75 }; | |
| 76 | |
| 77 } // namespace chrome | |
| 78 | |
| 79 #endif // CHROME_BROWSER_MEDIA_GALLERY_WIN_MTP_DEVICE_OBJECT_ENTRY_H_ | |
| OLD | NEW |