-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstorage_info.h
55 lines (43 loc) · 1.31 KB
/
storage_info.h
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
53
54
55
// Copyright 2012 The ChromiumOS Authors
// 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>
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,
const std::string& serial_number);
StorageInfo();
~StorageInfo();
void Update(const LIBMTP_devicestorage_t& storage);
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_;
// From LIBMTP_mtpdevice_t.
std::string serial_number_;
};
} // namespace mtpd
#endif // MTPD_STORAGE_INFO_H_