Crow  1.1
A C++ microframework for the web
crow::json::wvalue Class Reference

JSON write value. More...

#include <json.h>

Inheritance diagram for crow::json::wvalue:
crow::returnable

Public Types

using object = std::unordered_map< std::string, wvalue >
 
using list = std::vector< wvalue >
 

Public Member Functions

type t () const
 
 wvalue (std::nullptr_t)
 
 wvalue (bool value)
 
 wvalue (std::uint8_t value)
 
 wvalue (std::uint16_t value)
 
 wvalue (std::uint32_t value)
 
 wvalue (std::uint64_t value)
 
 wvalue (std::int8_t value)
 
 wvalue (std::int16_t value)
 
 wvalue (std::int32_t value)
 
 wvalue (std::int64_t value)
 
 wvalue (float value)
 
 wvalue (double value)
 
 wvalue (char const *value)
 
 wvalue (std::string const &value)
 
 wvalue (std::string &&value)
 
 wvalue (std::initializer_list< std::pair< std::string const, wvalue >> initializer_list)
 
 wvalue (object const &value)
 
 wvalue (object &&value)
 
 wvalue (const list &r)
 
 wvalue (list &r)
 
 wvalue (const rvalue &r)
 Create a write value from a read value (useful for editing JSON strings).
 
 wvalue (const wvalue &r)
 
 wvalue (wvalue &&r)
 
wvalueoperator= (wvalue &&r)
 
void clear ()
 Used for compatibility, same as reset()
 
void reset ()
 
wvalueoperator= (std::nullptr_t)
 
wvalueoperator= (bool value)
 
wvalueoperator= (float value)
 
wvalueoperator= (double value)
 
wvalueoperator= (unsigned short value)
 
wvalueoperator= (short value)
 
wvalueoperator= (long long value)
 
wvalueoperator= (long value)
 
wvalueoperator= (int value)
 
wvalueoperator= (unsigned long long value)
 
wvalueoperator= (unsigned long value)
 
wvalueoperator= (unsigned int value)
 
wvalueoperator= (const char *str)
 
wvalueoperator= (const std::string &str)
 
wvalueoperator= (list &&v)
 
template<typename T >
wvalueoperator= (const std::vector< T > &v)
 
wvalueoperator= (std::initializer_list< std::pair< std::string const, wvalue >> initializer_list)
 
wvalueoperator= (object const &value)
 
wvalueoperator= (object &&value)
 
wvalueoperator= (std::function< std::string(std::string &)> &&func)
 
wvalueoperator[] (unsigned index)
 
const wvalueoperator[] (unsigned index) const
 
int count (const std::string &str) const
 
wvalueoperator[] (const std::string &str)
 
const wvalueoperator[] (const std::string &str) const
 
std::vector< std::string > keys () const
 
std::string execute (std::string txt="") const
 
std::size_t size () const
 If the wvalue is a list, it returns the length of the list, otherwise it returns 1.
 
size_t estimate_length () const
 Returns an estimated size of the value in bytes.
 
std::string dump (const int indent, const char separator=' ') const
 
std::string dump () const override
 
- Public Member Functions inherited from crow::returnable
 returnable (std::string ctype)
 

Static Public Member Functions

static crow::json::wvalue empty_object ()
 Create an empty json value (outputs "{}" instead of a "null" string)
 

Friends

class crow::mustache::template_t
 
struct wvalue_reader
 

Additional Inherited Members

- Public Attributes inherited from crow::returnable
std::string content_type
 

Detailed Description

JSON write value.

Value can mean any json value, including a JSON object.
Write means this class is used to primarily assemble JSON objects using keys and values and export those into a string.


The documentation for this class was generated from the following file: