15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_JSON_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_JSON_H
18#include "google/cloud/spanner/version.h"
25GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
28
29
30
31
32
33
34
35
36
37
38
42 Json() : rep_(
"null") {}
53
54
55
56
57 explicit Json(std::string s) : rep_(std::move(s)) {}
61 explicit operator std::string()
const& {
return rep_; }
62 explicit operator std::string() && {
return std::move(rep_); }
72 return std::string(lhs) == std::string(rhs);
80inline std::ostream& operator<<(std::ostream& os,
Json const& json) {
81 return os << std::string(json);
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
104 JsonB() : rep_(
"null") {}
115
116
117
118
119 explicit JsonB(std::string s) : rep_(std::move(s)) {}
123 explicit operator std::string()
const& {
return rep_; }
124 explicit operator std::string() && {
return std::move(rep_); }
134 return std::string(lhs) == std::string(rhs);
137 return !(lhs
== rhs);
142inline std::ostream& operator<<(std::ostream& os,
JsonB const& json) {
143 return os << std::string(json);
146GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
JsonB is a variant of Json (see above).
Definition: json.h:101
JsonB & operator=(JsonB &&)=default
JsonB()
A null value.
Definition: json.h:104
operator std::string() const &
Definition: json.h:123
JsonB & operator=(JsonB const &)=default
JsonB(std::string s)
Construction from a JSON-formatted string.
Definition: json.h:119
operator std::string() &&
Definition: json.h:124
JsonB(JsonB const &)=default
A simple representation for the Spanner JSON type: a lightweight, text-based, language-independent da...
Definition: json.h:39
Json & operator=(Json &&)=default
Json(Json const &)=default
Json & operator=(Json const &)=default
operator std::string() const &
Definition: json.h:61
Json()
A null value.
Definition: json.h:42
operator std::string() &&
Definition: json.h:62
Json(std::string s)
Construction from a JSON-formatted string.
Definition: json.h:57
Contains all the Cloud Spanner C++ client types and functions.
Definition: backoff_policy.h:23
bool operator==(JsonB const &lhs, JsonB const &rhs)
Definition: json.h:133
bool operator==(Json const &lhs, Json const &rhs)
Definition: json.h:71
bool operator!=(JsonB const &lhs, JsonB const &rhs)
Definition: json.h:136
bool operator!=(Json const &lhs, Json const &rhs)
Definition: json.h:74