blob: ef111a660c8b791ce0b1a8b7782c3cea7917ed14 [file] [log] [blame]
Lei Zhang91af91d2012-08-03 11:02:20 -07001// Copyright (c) 2012 The Chromium OS 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 MTPD_FILE_ENTRY_H_
6#define MTPD_FILE_ENTRY_H_
7
8#include <libmtp.h>
9
10#include <dbus-c++/dbus.h>
11#include <map>
12#include <string>
13#include <vector>
14
15#include <base/basictypes.h>
16
17namespace mtpd {
18
19typedef std::map<std::string, DBus::Variant> DBusFileEntry;
20typedef std::vector<DBusFileEntry> DBusFileEntries;
21
22class FileEntry {
23 public:
24 explicit FileEntry(const LIBMTP_file_struct& file);
25 ~FileEntry();
26
27 DBusFileEntry ToDBusFormat() const;
28
29 private:
30 uint32_t item_id_;
31 uint32_t parent_id_;
32 std::string file_name_;
33 uint64_t file_size_;
34 time_t modification_date_;
35 LIBMTP_filetype_t file_type_;
36};
37
38} // namespace mtpd
39
40#endif // MTPD_FILE_ENTRY_H_