| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DISK_H__ | 5 #ifndef DISK_H__ |
| 6 #define DISK_H__ | 6 #define DISK_H__ |
| 7 | 7 |
| 8 #include <base/basictypes.h> | 8 #include <base/basictypes.h> |
| 9 #include <dbus-c++/dbus.h> // NOLINT | 9 #include <dbus-c++/dbus.h> // NOLINT |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 namespace cros_disks { | 14 namespace cros_disks { |
| 15 | 15 |
| 16 typedef std::map<std::string, DBus::Variant> DBusDisk; | 16 typedef std::map<std::string, DBus::Variant> DBusDisk; |
| 17 typedef std::vector<DBusDisk> DBusDisks; | 17 typedef std::vector<DBusDisk> DBusDisks; |
| 18 | 18 |
| 19 // A simple type that describes a storage device attached to our system. | 19 // A simple type that describes a storage device attached to our system. |
| 20 // | 20 // |
| 21 // This class was designed to run in a single threaded context and should not | 21 // This class was designed to run in a single threaded context and should not |
| 22 // be considered thread safe. | 22 // be considered thread safe. |
| 23 class Disk { | 23 class Disk { |
| 24 public: | 24 public: |
| 25 | 25 |
| 26 Disk(); | 26 Disk(); |
| 27 virtual ~Disk(); | 27 virtual ~Disk(); |
| 28 DBusDisk ToDBusFormat() const; |
| 28 | 29 |
| 29 bool is_drive() const { return is_drive_; } | 30 bool is_drive() const { return is_drive_; } |
| 30 void set_is_drive(bool is_drive) { is_drive_ = is_drive; } | 31 void set_is_drive(bool is_drive) { is_drive_ = is_drive; } |
| 31 | 32 |
| 32 bool is_hidden() const { return is_hidden_; } | 33 bool is_hidden() const { return is_hidden_; } |
| 33 void set_is_hidden(bool is_hidden) { is_hidden_ = is_hidden; } | 34 void set_is_hidden(bool is_hidden) { is_hidden_ = is_hidden; } |
| 34 | 35 |
| 35 bool is_mounted() const { return is_mounted_; } | 36 bool is_mounted() const { return is_mounted_; } |
| 36 void set_is_mounted(bool is_mounted) { is_mounted_ = is_mounted; } | 37 void set_is_mounted(bool is_mounted) { is_mounted_ = is_mounted; } |
| 37 | 38 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 std::string label_; | 98 std::string label_; |
| 98 std::string drive_model_; | 99 std::string drive_model_; |
| 99 uint64 device_capacity_; | 100 uint64 device_capacity_; |
| 100 uint64 bytes_remaining_; | 101 uint64 bytes_remaining_; |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 } // namespace cros_disks | 104 } // namespace cros_disks |
| 104 | 105 |
| 105 | 106 |
| 106 #endif // DISK_H__ | 107 #endif // DISK_H__ |
| OLD | NEW |