summaryrefslogtreecommitdiff
path: root/chromium/third_party/mtpd/source/storage_info.h
blob: 68f816d03c49446129c87650c8a19f668dc4cbc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// 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.

#ifndef MTPD_STORAGE_INFO_H_
#define MTPD_STORAGE_INFO_H_

#include <libmtp.h>

#include <string>
#include <vector>

#include <base/basictypes.h>

namespace mtpd {

class StorageInfo {
 public:
  StorageInfo(const std::string& storage_name,
              const LIBMTP_device_entry_t& device,
              const LIBMTP_devicestorage_t& storage,
              const std::string& fallback_vendor,
              const std::string& fallback_product);
  StorageInfo();
  ~StorageInfo();

  std::vector<uint8_t> ToDBusFormat() const;

 private:
  std::string storage_name_;

  // From LIBMTP_device_entry_t.
  std::string vendor_;
  uint16_t vendor_id_;
  std::string product_;
  uint16_t product_id_;
  uint32_t device_flags_;

  // From LIBMTP_devicestorage_t.
  uint16_t storage_type_;
  uint16_t filesystem_type_;
  uint16_t access_capability_;
  uint64_t max_capacity_;
  uint64_t free_space_in_bytes_;
  uint64_t free_space_in_objects_;
  std::string storage_description_;
  std::string volume_identifier_;
};

}  // namespace mtpd

#endif  // MTPD_STORAGE_INFO_H_