json/tree: add as_chars accessor

This commit is contained in:
Danny Robson 2015-03-18 15:48:01 +11:00
parent b01635141f
commit 6e81437b93
2 changed files with 8 additions and 0 deletions

View File

@ -265,6 +265,13 @@ json::tree::node::as_uint (void) const
}
//-----------------------------------------------------------------------------
const char*
json::tree::node::as_chars (void) const
{
return as_string ().native ().c_str ();
}
//-----------------------------------------------------------------------------
// Global operatoers

View File

@ -66,6 +66,7 @@ namespace json { namespace tree {
virtual float as_float (void) const;
virtual double as_double (void) const;
virtual size_t as_uint (void) const;
virtual const char* as_chars (void) const;
virtual bool is_object (void) const { return false; }
virtual bool is_array (void) const { return false; }