#3114: Added JSON Array::empty() method

This commit is contained in:
Günter Obiltschnig
2021-04-12 20:33:11 +02:00
parent e577e36c25
commit 15ad5c250e
2 changed files with 13 additions and 0 deletions

View File

@@ -124,6 +124,9 @@ public:
std::size_t size() const;
/// Returns the size of the array.
bool empty() const;
/// Returns true if the array is empty, false otherwise.
bool isArray(unsigned int index) const;
/// Returns true when the element is an array.
@@ -241,6 +244,12 @@ inline std::size_t Array::size() const
}
inline bool Array::empty() const
{
return _values.empty();
}
inline bool Array::isArray(unsigned int index) const
{
Dynamic::Var value = get(index);