- Implemented ::trivial to faclitate operator shortcuts.
This commit is contained in:
Paul Beckingham 2014-06-16 17:25:48 -04:00
parent 841c78768c
commit 8e16a3e0e4
2 changed files with 14 additions and 0 deletions

View file

@ -1763,6 +1763,19 @@ int Variant::type ()
return _type;
}
////////////////////////////////////////////////////////////////////////////////
bool Variant::trivial () const
{
return (_type == type_unknown) ||
(_type == type_integer && _integer == 0) ||
(_type == type_real && _real == 0.0) ||
(_type == type_string && _string == "") ||
(_type == type_date && _date == 0) ||
(_type == type_duration && _duration == 0);
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool Variant::get_bool () const
{

View file

@ -95,6 +95,7 @@ public:
void cast (const enum type);
int type ();
bool trivial () const;
bool get_bool () const;
int get_integer () const;