From 1d0240ba1080f7bceb7f43cb75f355e75261bdaf Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 18 Mar 2015 16:01:10 +1100 Subject: [PATCH] json/tree: move some array methods to cpp --- json/tree.cpp | 16 ++++++++++++++++ json/tree.hpp | 6 ++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/json/tree.cpp b/json/tree.cpp index 39568267..213512f4 100644 --- a/json/tree.cpp +++ b/json/tree.cpp @@ -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) diff --git a/json/tree.hpp b/json/tree.hpp index 19a85cca..fdfce417 100644 --- a/json/tree.hpp +++ b/json/tree.hpp @@ -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;