Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
Public Member Functions | List of all members
google::cloud::spanner::Json Class Reference

A simple representation for the Spanner JSON type: a lightweight, text-based, language-independent data interchange format. More...

#include <google/cloud/spanner/json.h>

Public Member Functions

 Json ()
 A null value. More...
 
 Json (std::string s)
 Construction from a JSON-formatted string. More...
 
Regular value type, supporting copy, assign, move.
 Json (Json const &)=default
 
Jsonoperator= (Json const &)=default
 
 Json (Json &&)=default
 
Jsonoperator= (Json &&)=default
 
Conversion to a JSON-formatted string.
 operator std::string () const &
 
 operator std::string () &&
 

Detailed Description

A simple representation for the Spanner JSON type: a lightweight, text-based, language-independent data interchange format.

JSON (the JavaScript Object Notation) defines a small set of formatting rules for the portable representation of structured data. See RFC 7159.

A Json value can be constructed from, and converted to a std::string. Json values can be compared (by string) for equality, and streamed.

There is no syntax checking of JSON strings in this interface. The user is expected to only construct Json values from well-formatted strings.

Constructor & Destructor Documentation

◆ Json() [1/4]

google::cloud::spanner::Json::Json ( )
inline

A null value.

◆ Json() [2/4]

google::cloud::spanner::Json::Json ( Json const &  )
default

◆ Json() [3/4]

google::cloud::spanner::Json::Json ( Json &&  )
default

◆ Json() [4/4]

google::cloud::spanner::Json::Json ( std::string  s)
inlineexplicit

Construction from a JSON-formatted string.

Note that there is no check here that the argument string is indeed well-formatted. Error detection will be delayed until the value is passed to Spanner.

Member Function Documentation

◆ operator std::string() [1/2]

google::cloud::spanner::Json::operator std::string ( ) &&
inlineexplicit

◆ operator std::string() [2/2]

google::cloud::spanner::Json::operator std::string ( ) const &
inlineexplicit

◆ operator=() [1/2]

Json & google::cloud::spanner::Json::operator= ( Json &&  )
default

◆ operator=() [2/2]

Json & google::cloud::spanner::Json::operator= ( Json const &  )
default