Add Path::IsEmpty

Signed-off-by: Nicholas Van Sickle <nvsickle@amazon.com>
This commit is contained in:
Nicholas Van Sickle
2022-01-27 13:44:35 -08:00
parent 73f166241e
commit 155cc5845b
3 changed files with 7 additions and 1 deletions
@@ -395,7 +395,7 @@ namespace AZ::Dom
const bool allowEndOfArray = (flags & ExistenceCheckFlags::AllowEndOfArray) != ExistenceCheckFlags::DefaultExistenceCheck;
Path target = path;
if (target.Size() == 0)
if (target.IsEmpty())
{
Value wrapper(Dom::Type::Array);
wrapper.ArrayPushBack(rootElement);
@@ -246,6 +246,11 @@ namespace AZ::Dom
return m_entries.size();
}
bool Path::IsEmpty() const
{
return m_entries.empty();
}
PathEntry& Path::operator[](size_t index)
{
return m_entries[index];
@@ -111,6 +111,7 @@ namespace AZ::Dom
void Clear();
PathEntry At(size_t index) const;
size_t Size() const;
bool IsEmpty() const;
PathEntry& operator[](size_t index);
const PathEntry& operator[](size_t index) const;