mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Request: Minor code cleanup
This commit is contained in:
parent
3400bfdc9a
commit
55755ae066
@ -37,9 +37,8 @@ const bool Request::ValidateBasic(const std::string keyName, RequestStatus::Requ
|
||||
|
||||
const bool Request::ValidateNumber(const std::string keyName, RequestStatus::RequestStatus &statusCode, std::string &comment, const double minValue, const double maxValue) const
|
||||
{
|
||||
if (!ValidateBasic(keyName, statusCode, comment)) {
|
||||
if (!ValidateBasic(keyName, statusCode, comment))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!RequestData[keyName].is_number()) {
|
||||
statusCode = RequestStatus::InvalidRequestParameterDataType;
|
||||
@ -64,9 +63,8 @@ const bool Request::ValidateNumber(const std::string keyName, RequestStatus::Req
|
||||
|
||||
const bool Request::ValidateString(const std::string keyName, RequestStatus::RequestStatus &statusCode, std::string &comment, const bool allowEmpty) const
|
||||
{
|
||||
if (!ValidateBasic(keyName, statusCode, comment)) {
|
||||
if (!ValidateBasic(keyName, statusCode, comment))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!RequestData[keyName].is_string()) {
|
||||
statusCode = RequestStatus::InvalidRequestParameterDataType;
|
||||
@ -85,9 +83,8 @@ const bool Request::ValidateString(const std::string keyName, RequestStatus::Req
|
||||
|
||||
const bool Request::ValidateBoolean(const std::string keyName, RequestStatus::RequestStatus &statusCode, std::string &comment) const
|
||||
{
|
||||
if (!ValidateBasic(keyName, statusCode, comment)) {
|
||||
if (!ValidateBasic(keyName, statusCode, comment))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!RequestData[keyName].is_boolean()) {
|
||||
statusCode = RequestStatus::InvalidRequestParameterDataType;
|
||||
@ -100,9 +97,8 @@ const bool Request::ValidateBoolean(const std::string keyName, RequestStatus::Re
|
||||
|
||||
const bool Request::ValidateObject(const std::string keyName, RequestStatus::RequestStatus &statusCode, std::string &comment, const bool allowEmpty) const
|
||||
{
|
||||
if (!ValidateBasic(keyName, statusCode, comment)) {
|
||||
if (!ValidateBasic(keyName, statusCode, comment))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!RequestData[keyName].is_object()) {
|
||||
statusCode = RequestStatus::InvalidRequestParameterDataType;
|
||||
@ -121,9 +117,8 @@ const bool Request::ValidateObject(const std::string keyName, RequestStatus::Req
|
||||
|
||||
const bool Request::ValidateArray(const std::string keyName, RequestStatus::RequestStatus &statusCode, std::string &comment, const bool allowEmpty) const
|
||||
{
|
||||
if (!ValidateBasic(keyName, statusCode, comment)) {
|
||||
if (!ValidateBasic(keyName, statusCode, comment))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!RequestData[keyName].is_array()) {
|
||||
statusCode = RequestStatus::InvalidRequestParameterDataType;
|
||||
|
Loading…
Reference in New Issue
Block a user