JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
value.hpp File Reference

Copyright (c) 2012-2020 by Travis Gockel. More...

#include <jsonv/config.hpp>
#include <jsonv/kind.hpp>
#include <string_view>
#include <jsonv/detail/basic_view.hpp>
#include <cstddef>
#include <cstdint>
#include <initializer_list>
#include <iosfwd>
#include <iterator>
#include <functional>
#include <map>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <utility>
+ Include dependency graph for value.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  jsonv::kind_error
 Thrown from various value methods when attempting to perform an operation which is not valid for the kind of value. More...
 
class  jsonv::value
 Represents a single JSON value, which can be any one of a potential kind, each behaving slightly differently. More...
 
struct  jsonv::value::basic_array_iterator< T, TArrayView >
 The base type for iterating over array values. More...
 
struct  jsonv::value::basic_object_iterator< T, TIterator >
 The base iterator type for iterating over object types. More...
 
struct  jsonv::value::object_insert_return_type
 Type returned from insert operations when this has kind::object. More...
 
class  jsonv::object_node_handle
 A node handle used when a value is kind::object to access elements of the object in potentially destructive manner. More...
 

Namespaces

namespace  std
 STL namespace.
 

Macros

#define JSONV_VALUE_INTEGER_ALTERNATIVE_CTOR_PROTO_GENERATOR(type_)    value(type_ val);
 

Functions

JSONV_PUBLIC std::string jsonv::to_string (const value &)
 Get a string representation of the given value.
 
JSONV_PUBLIC value jsonv::operator""_json (const char *str, std::size_t len)
 A user-defined literal for parsing JSON.
 
JSONV_PUBLIC void jsonv::swap (value &a, value &b) noexcept
 Swap the values a and b.
 
JSONV_PUBLIC value jsonv::array ()
 Create an empty array value.
 
JSONV_PUBLIC value jsonv::array (std::initializer_list< value > source)
 Create an array value from the given source.
 
template<typename TForwardIterator >
value jsonv::array (TForwardIterator first, TForwardIterator last)
 Create an array with contents defined by range [first, last).
 
JSONV_PUBLIC value jsonv::object ()
 Create an empty object.
 
JSONV_PUBLIC value jsonv::object (std::initializer_list< std::pair< std::string, value > > source)
 Create an object with key-value pairs from the given source.
 
JSONV_PUBLIC value jsonv::object (std::initializer_list< std::pair< std::wstring, value > > source)
 
template<typename TForwardIterator >
value jsonv::object (TForwardIterator first, TForwardIterator last)
 Create an object whose contents are defined by range [first, last).
 

Variables

JSONV_PUBLIC const value jsonv::null
 An instance with kind::null.
 

Detailed Description

Copyright (c) 2012-2020 by Travis Gockel.

All rights reserved.

This program is free software: you can redistribute it and/or modify it under the terms of the Apache License as published by the Apache Software Foundation, either version 2 of the License, or (at your option) any later version.

Author
Travis Gockel (travi.nosp@m.s@go.nosp@m.ckelh.nosp@m.ut.c.nosp@m.om)

Definition in file value.hpp.


Class Documentation

◆ jsonv::value::object_insert_return_type

struct jsonv::value::object_insert_return_type

Type returned from insert operations when this has kind::object.

It is generally compatible with the insert_return_type of std::map, with the notable lack of node.

See also
insert

Definition at line 404 of file value.hpp.

+ Collaboration diagram for jsonv::value::object_insert_return_type:
Class Members
bool inserted Did the insert operation perform an insert? A value of false indicates there was a key already present with the same name.
const_object_iterator position The position of the inserted node or node with the duplicate key.

Macro Definition Documentation

◆ JSONV_VALUE_INTEGER_ALTERNATIVE_CTOR_PROTO_GENERATOR

#define JSONV_VALUE_INTEGER_ALTERNATIVE_CTOR_PROTO_GENERATOR (   type_)     value(type_ val);

Definition at line 460 of file value.hpp.