From cf69a5ba7a6923dfdad6bff254f8887696eb3fc5 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 19 Apr 2012 16:45:10 +1000 Subject: [PATCH] Add json::string::size method --- json.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/json.hpp b/json.hpp index 5f7e42ab..9b23fc00 100644 --- a/json.hpp +++ b/json.hpp @@ -169,6 +169,8 @@ namespace json { virtual bool operator==(const node &rhs) const { return rhs == *this; } + virtual size_t size (void) const { return m_value.size (); } + operator const std::string&(void) const { return m_value; } const std::string& native (void) const { return m_value; } @@ -264,6 +266,13 @@ namespace json { error (_what) { ; } }; + + + template + json::node&& to_json (const T&); + + template + T&& from_json (const json::node&); }