# Crow: crow::json::wvalue Class Reference

Loading...
Searching...
No Matches
crow::json::wvalue Class Reference

JSON write value. More...

`#include <json.h>`

Inheritance diagram for crow::json::wvalue:

## 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)
wvalue & | operator= (wvalue &&r)
void | clear ()
| Used for compatibility, same as reset()
void | reset ()
wvalue & | operator= (std::nullptr_t)
wvalue & | operator= (bool value)
wvalue & | operator= (float value)
wvalue & | operator= (double value)
wvalue & | operator= (unsigned short value)
wvalue & | operator= (short value)
wvalue & | operator= (long long value)
wvalue & | operator= (long value)
wvalue & | operator= (int value)
wvalue & | operator= (unsigned long long value)
wvalue & | operator= (unsigned long value)
wvalue & | operator= (unsigned int value)
wvalue & | operator= (const char *str)
wvalue & | operator= (const std::string &str)
wvalue & | operator= (list &&v)
template<typename T >
wvalue & | operator= (const std::vector< T > &v)
wvalue & | operator= (std::initializer_list< std::pair< std::string const, wvalue > > initializer_list)
wvalue & | operator= (object const &value)
wvalue & | operator= (object &&value)
wvalue & | operator= (std::function< std::string(std::string &)> &&func)
wvalue & | operator[] (unsigned index)
const wvalue & | operator[] (unsigned index) const
int | count (const std::string &str) const
wvalue & | operator[] (const std::string &str)
const wvalue & | operator[] (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
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.

## Member Function Documentation

## dump()

std::string crow::json::wvalue::dump | ( |  | ) | const

inlinevirtual

Implements crow::returnable.

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

- include/crow/json.h