diff options
author | Robin Krahl <me@robin-krahl.de> | 2019-01-13 12:04:42 +0100 |
---|---|---|
committer | Robin Krahl <me@robin-krahl.de> | 2019-01-13 13:26:59 +0100 |
commit | 66763febd7990f35d34345175257b2ad9401e829 (patch) | |
tree | 837b0f6867dc91ae257067de3d25ba7adc17b4a7 /device.cc | |
parent | 14635f49813df1699569d3b13456ea33955de54b (diff) | |
download | libnitrokey-66763febd7990f35d34345175257b2ad9401e829.tar.gz libnitrokey-66763febd7990f35d34345175257b2ad9401e829.tar.bz2 |
Implement operator<< for DeviceModel
Diffstat (limited to 'device.cc')
-rw-r--r-- | device.cc | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -57,6 +57,21 @@ Option<DeviceModel> nitrokey::device::product_id_to_model(uint16_t product_id) { std::atomic_int Device::instances_count{0}; std::chrono::milliseconds Device::default_delay {0} ; +std::ostream& nitrokey::device::operator<<(std::ostream& stream, DeviceModel model) { + switch (model) { + case DeviceModel::PRO: + stream << "Pro"; + break; + case DeviceModel::STORAGE: + stream << "Storage"; + break; + default: + stream << "Unknown"; + break; + } + return stream; +} + Device::Device(const uint16_t vid, const uint16_t pid, const DeviceModel model, const milliseconds send_receive_delay, const int retry_receiving_count, const milliseconds retry_timeout) |