blob: 5ea336878d469003428219cbca81ad658dbf07e6 [file] [log] [blame]
// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <libmtp.h>
#include <string>
#include <vector>
#include <base/macros.h>
#include "system_api/proto_bindings/mtp_file_entry.pb.h"
namespace mtpd {
class FileEntry {
explicit FileEntry(const LIBMTP_file_struct& file);
MtpFileEntry ToProtobuf() const;
std::vector<uint8_t> ToDBusFormat() const;
static std::vector<uint8_t> EmptyFileEntriesToDBusFormat();
static std::vector<uint8_t> FileEntriesToDBusFormat(
const std::vector<FileEntry>& entries);
uint32_t item_id() const { return item_id_; }
uint32_t parent_id() const { return parent_id_; }
const std::string& file_name() const { return file_name_; }
uint64_t file_size() const { return file_size_; }
time_t modification_time() const { return modification_time_; }
LIBMTP_filetype_t file_type() const { return file_type_; }
uint32_t item_id_;
uint32_t parent_id_;
std::string file_name_;
uint64_t file_size_;
time_t modification_time_;
LIBMTP_filetype_t file_type_;
} // namespace mtpd
#endif // MTPD_FILE_ENTRY_H_