Compartir a través de


value Class

A JSON value represented as a C++ class.

Warning

This topic contains information for the C++ REST SDK 1.0 (codename "Casablanca"). If you are using a later version from the Codeplex Casablanca web page, then use the local documentation at http://casablanca.codeplex.com/documentation.

class value;

Members

Public Typedefs

Name

Description

const_iterator

Defined in support for STL algorithms that rely on iterators. This identifies the type of the const iterator.

const_reverse_iterator

Defined in support for STL algorithms that rely on iterators. This identifies the type of the const iterator.

element_vector

Typedef for the standard container holding array elements. This is used when constructing an array from existing objects.

field_map

Typedef for the standard container holding fields. This is used when constructing an object from existing objects.

iterator

Defined in support for STL algorithms that rely on iterators. This identifies the type of the non-const iterator.

reverse_iterator

Defined in support for STL algorithms that rely on iterators. This identifies the type of the non-const iterator.

Public Enumerations

Name

Description

value::value_type Enumeration

This enumeration represents the various kinds of JSON values.

Public Constructors

Name

Description

value::value Constructor

Overloaded. Constructor creating a null value

Public Methods

Name

Description

value::array Method

Overloaded. Create an empty JSON array

value::as_bool Method

Convert the JSON value to a C++ bool, if and only if it is a Boolean value.

value::as_double Method

Convert the JSON value to a C++ double, if and only if it is a number value. Throws json_exception if the value is not a number

value::as_integer Method

Convert the JSON value to a C++ integer, if and only if it is a number value. Throws json_exception if the value is not a number

value::as_string Method

Convert the JSON value to a C++ STL string, if and only if it is a string value.

value::begin Method

Gets the beginning iterator element for a composite value.

value::boolean Method

Create a Boolean value

value::cbegin Method

Gets the beginning const iterator element for a composite value.

value::cend Method

Gets the end const iterator element for a composite value.

value::crbegin Method

Get the beginning const reverse iterator element for a composite value.

value::crend Method

Get the end const reverse iterator element for a composite value.

value::end Method

Gets the end iterator element for a composite value.

value::is_array Method

Is the current value an array?

value::is_boolean Method

Is the current value a Boolean value?

value::is_null Method

Is the current value a null value?

value::is_number Method

Is the current value a number value?

value::is_object Method

Is the current value an object?

value::is_string Method

Is the current value a string value?

value::null Method

Creates a null value

value::number Method

Overloaded. Creates a number value

value::object Method

Overloaded. Create an object value

value::parse Method

Overloaded. Constructor creating a JSON value from an input stream, by parsing its contents.

value::rbegin Method

Gets the beginning reverse iterator element for a composite value.

value::rend Method

Gets the end reverse iterator element for a composite value.

value::serialize Method

Overloaded. Write the current JSON value as a double-byte string to a stream instance.

value::size Method

How many children does the value have?

value::string Method

Create a string value

value::to_string Method

Serialize the current JSON value to a C++ string.

value::type Method

Access the type of JSON value the current value instance is

Public Operators

Name

Description

value::operator!= Operator

Compare two JSON values for inequality.

value::operator[] Operator

Overloaded. Access a field of a JSON object.

value::operator= Operator

Overloaded. Assignment operator.

value::operator== Operator

Compare two JSON values for equality.

Requirements

Header: json.h

Namespace: web::json

See Also

Reference

web::json Namespace