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 #ifndef CHROME_BROWSER_MEDIA_GALLERY_LINUX_MTP_DEVICE_OBJECT_ENUMERATOR_H_ |
| 6 #define CHROME_BROWSER_MEDIA_GALLERY_LINUX_MTP_DEVICE_OBJECT_ENUMERATOR_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/file_path.h" |
| 11 #include "base/time.h" |
| 12 #include "chrome/browser/media_transfer_protocol/mtp_file_entry.pb.h" |
| 13 #include "webkit/fileapi/file_system_file_util.h" |
| 14 |
| 15 namespace chrome { |
| 16 |
| 17 typedef std::vector<MtpFileEntry> MtpFileEntries; |
| 18 |
| 19 // Used to enumerate top-level files of an media file system. |
| 20 class MTPDeviceObjectEnumerator |
| 21 : public fileapi::FileSystemFileUtil::AbstractFileEnumerator { |
| 22 public: |
| 23 explicit MTPDeviceObjectEnumerator(const MtpFileEntries& entries); |
| 24 |
| 25 virtual ~MTPDeviceObjectEnumerator(); |
| 26 |
| 27 // AbstractFileEnumerator: |
| 28 virtual FilePath Next() OVERRIDE; |
| 29 virtual int64 Size() OVERRIDE; |
| 30 virtual bool IsDirectory() OVERRIDE; |
| 31 virtual base::Time LastModifiedTime() OVERRIDE; |
| 32 |
| 33 private: |
| 34 // List of directory file entries information. |
| 35 const MtpFileEntries file_entries_; |
| 36 |
| 37 // Iterator to access the individual file entries. |
| 38 MtpFileEntries::const_iterator file_entry_iter_; |
| 39 |
| 40 // Stores the current file information. |
| 41 MtpFileEntry current_file_info_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(MTPDeviceObjectEnumerator); |
| 44 }; |
| 45 |
| 46 } // namespace chrome |
| 47 |
| 48 #endif // CHROME_BROWSER_MEDIA_GALLERY_LINUX_MTP_DEVICE_OBJECT_ENUMERATOR_H_ |
OLD | NEW |