json/tree: move some array methods to cpp

This commit is contained in:
Danny Robson 2015-03-18 16:01:10 +11:00
parent f333c75218
commit 1d0240ba10
2 changed files with 18 additions and 4 deletions

View File

@ -534,6 +534,22 @@ json::tree::array::operator==(const json::tree::array &rhs) const
}
//-----------------------------------------------------------------------------
bool
json::tree::array::operator== (const node &rhs) const
{
return rhs == *this;
}
//-----------------------------------------------------------------------------
size_t
json::tree::array::size (void) const
{
return m_values.size ();
}
//-----------------------------------------------------------------------------
json::tree::node&
json::tree::array::operator[] (unsigned int idx)

View File

@ -173,11 +173,9 @@ namespace json { namespace tree {
virtual type_t type (void) const { return ARRAY; }
virtual bool operator==(const array &rhs) const;
virtual bool operator==(const node &rhs) const
{ return rhs == *this; }
virtual bool operator==(const node &rhs) const;
virtual size_t size (void) const
{ return m_values.size (); }
virtual size_t size (void) const;
virtual node& operator [](unsigned int idx);
virtual const node& operator [](unsigned int idx) const;