Use consistent code style
Only files that are currently used in logid are changed.
This commit is contained in:
@@ -11,32 +11,31 @@ Error::Error(uint8_t code) : _code (code)
|
||||
|
||||
const char* Error::what() const noexcept
|
||||
{
|
||||
switch(_code)
|
||||
{
|
||||
case NoError:
|
||||
return "No error";
|
||||
case Unknown:
|
||||
return "Unknown";
|
||||
case InvalidArgument:
|
||||
return "Invalid argument";
|
||||
case OutOfRange:
|
||||
return "Out of range";
|
||||
case HardwareError:
|
||||
return "Hardware error";
|
||||
case LogitechInternal:
|
||||
return "Logitech internal feature";
|
||||
case InvalidFeatureIndex:
|
||||
return "Invalid feature index";
|
||||
case InvalidFunctionID:
|
||||
return "Invalid function ID";
|
||||
case Busy:
|
||||
return "Busy";
|
||||
case Unsupported:
|
||||
return "Unsupported";
|
||||
case UnknownDevice:
|
||||
return "Unknown device";
|
||||
default:
|
||||
return std::string("Unknown error code " + std::to_string(_code)).c_str();
|
||||
switch(_code) {
|
||||
case NoError:
|
||||
return "No error";
|
||||
case Unknown:
|
||||
return "Unknown";
|
||||
case InvalidArgument:
|
||||
return "Invalid argument";
|
||||
case OutOfRange:
|
||||
return "Out of range";
|
||||
case HardwareError:
|
||||
return "Hardware error";
|
||||
case LogitechInternal:
|
||||
return "Logitech internal feature";
|
||||
case InvalidFeatureIndex:
|
||||
return "Invalid feature index";
|
||||
case InvalidFunctionID:
|
||||
return "Invalid function ID";
|
||||
case Busy:
|
||||
return "Busy";
|
||||
case Unsupported:
|
||||
return "Unsupported";
|
||||
case UnknownDevice:
|
||||
return "Unknown device";
|
||||
default:
|
||||
return "Unknown error code";
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -26,9 +26,9 @@ namespace hidpp20 {
|
||||
UnknownDevice = 10
|
||||
};
|
||||
|
||||
Error(uint8_t code);
|
||||
explicit Error(uint8_t code);
|
||||
|
||||
virtual const char* what() const noexcept;
|
||||
const char* what() const noexcept override;
|
||||
uint8_t code() const noexcept;
|
||||
|
||||
private:
|
||||
|
@@ -11,7 +11,7 @@ namespace hidpp20 {
|
||||
{
|
||||
public:
|
||||
explicit UnsupportedFeature(uint16_t ID) : _f_id (ID) {}
|
||||
virtual const char* what() const noexcept;
|
||||
const char* what() const noexcept override;
|
||||
uint16_t code() const noexcept;
|
||||
private:
|
||||
uint16_t _f_id;
|
||||
|
@@ -21,7 +21,7 @@ namespace hidpp20
|
||||
GetDeviceName = 1
|
||||
};
|
||||
|
||||
DeviceName(Device* device);
|
||||
explicit DeviceName(Device* device);
|
||||
|
||||
uint8_t getNameLength();
|
||||
std::string getName();
|
||||
@@ -33,7 +33,7 @@ namespace hidpp20
|
||||
static const uint16_t ID = FeatureID::DEVICE_NAME;
|
||||
virtual uint16_t getID() { return ID; }
|
||||
|
||||
EssentialDeviceName(hidpp::Device* device);
|
||||
explicit EssentialDeviceName(hidpp::Device* device);
|
||||
|
||||
uint8_t getNameLength();
|
||||
std::string getName();
|
||||
|
@@ -14,7 +14,8 @@ std::vector<uint8_t> _genGetFeatureParams(uint16_t feature_id)
|
||||
return params;
|
||||
}
|
||||
|
||||
feature_info _genGetFeatureInfo(uint16_t feature_id, std::vector<uint8_t> response)
|
||||
feature_info _genGetFeatureInfo(uint16_t feature_id,
|
||||
std::vector<uint8_t> response)
|
||||
{
|
||||
feature_info info{};
|
||||
info.feature_id = response[0];
|
||||
|
@@ -21,7 +21,7 @@ namespace hidpp20
|
||||
Ping = 1
|
||||
};
|
||||
|
||||
Root(Device* device);
|
||||
explicit Root(Device* device);
|
||||
|
||||
feature_info getFeature (uint16_t feature_id);
|
||||
std::tuple<uint8_t, uint8_t> getVersion();
|
||||
@@ -40,9 +40,9 @@ namespace hidpp20
|
||||
static const uint16_t ID = FeatureID::ROOT;
|
||||
virtual uint16_t getID() { return ID; }
|
||||
|
||||
EssentialRoot(hidpp::Device* device);
|
||||
explicit EssentialRoot(hidpp::Device* device);
|
||||
|
||||
feature_info getFeature (uint16_t feature_id);
|
||||
feature_info getFeature(uint16_t feature_id);
|
||||
std::tuple<uint8_t, uint8_t> getVersion();
|
||||
};
|
||||
}}}
|
||||
|
Reference in New Issue
Block a user