Add support for boolean arguments
This commit is contained in:
parent
31ad6655f1
commit
faf12ae6e7
@ -22,6 +22,12 @@ bool html_argument::is_number() const
|
||||
return this->value_->vt == VT_I4;
|
||||
}
|
||||
|
||||
bool html_argument::is_bool() const
|
||||
{
|
||||
if (this->is_empty()) return false;
|
||||
return this->value_->vt == VT_BOOL;
|
||||
}
|
||||
|
||||
std::string html_argument::get_string() const
|
||||
{
|
||||
if (!this->is_string()) return {};
|
||||
@ -34,3 +40,9 @@ int html_argument::get_number() const
|
||||
if (!this->is_number()) return 0;
|
||||
return this->value_->intVal;
|
||||
}
|
||||
|
||||
bool html_argument::get_bool() const
|
||||
{
|
||||
if(!this->is_bool()) return false;
|
||||
return this->value_->boolVal != FALSE;
|
||||
}
|
||||
|
@ -9,9 +9,11 @@ public:
|
||||
|
||||
bool is_string() const;
|
||||
bool is_number() const;
|
||||
bool is_bool() const;
|
||||
|
||||
std::string get_string() const;
|
||||
int get_number() const;
|
||||
bool get_bool() const;
|
||||
|
||||
private:
|
||||
VARIANT* value_;
|
||||
|
File diff suppressed because one or more lines are too long
@ -44,7 +44,7 @@
|
||||
|
||||
#include <gsl/gsl>
|
||||
|
||||
#pragma comment (lib, "gdiplus.lib")
|
||||
#pragma comment(lib, "gdiplus.lib")
|
||||
#pragma comment(lib, "ws2_32.lib")
|
||||
|
||||
#pragma warning(pop)
|
||||
|
Loading…
Reference in New Issue
Block a user