diff --git a/src/Variant.cpp b/src/Variant.cpp index b434426da..bcec3ab54 100644 --- a/src/Variant.cpp +++ b/src/Variant.cpp @@ -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 { diff --git a/src/Variant.h b/src/Variant.h index 77dcacc66..8073fdaf9 100644 --- a/src/Variant.h +++ b/src/Variant.h @@ -95,6 +95,7 @@ public: void cast (const enum type); int type (); + bool trivial () const; bool get_bool () const; int get_integer () const;