Google Cloud Spanner C++ Client  1.32.1
A C++ Client Library for Google Cloud Spanner
Public Member Functions | List of all members
google::cloud::spanner::v1::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...
 
 Json (Json const &)=default
 Regular value type, supporting copy, assign, move. More...
 
Jsonoperator= (Json const &)=default
 Regular value type, supporting copy, assign, move. More...
 
 Json (Json &&)=default
 Regular value type, supporting copy, assign, move. More...
 
Jsonoperator= (Json &&)=default
 Regular value type, supporting copy, assign, move. More...
 
 operator std::string () const &
 Conversion to a JSON-formatted string. More...
 
 operator std::string () &&
 Conversion to a JSON-formatted string. More...
 

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.

Definition at line 39 of file json.h.

Constructor & Destructor Documentation

◆ Json() [1/4]

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

A null value.

Definition at line 42 of file json.h.

◆ Json() [2/4]

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

Regular value type, supporting copy, assign, move.

◆ Json() [3/4]

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

Regular value type, supporting copy, assign, move.

◆ Json() [4/4]

google::cloud::spanner::v1::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.

Definition at line 57 of file json.h.

Member Function Documentation

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

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

Conversion to a JSON-formatted string.

Definition at line 62 of file json.h.

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

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

Conversion to a JSON-formatted string.

Definition at line 61 of file json.h.

◆ operator=() [1/2]

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

Regular value type, supporting copy, assign, move.

◆ operator=() [2/2]

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

Regular value type, supporting copy, assign, move.