Hazelcast C++ Client
Hazelcast C++ Client Library
hazelcast::client::hazelcast_json_value Class Reference

hazelcast_json_value is a wrapper for Json formatted strings. More...

#include <hazelcast_json_value.h>

Public Member Functions

 hazelcast_json_value (std::string json_string)
 Create a hazelcast_json_value from a string. More...
 
const std::string & to_string () const
 This method returns a Json representation of the object. More...
 
bool operator== (const hazelcast_json_value &rhs) const
 
bool operator!= (const hazelcast_json_value &rhs) const
 
bool operator< (const hazelcast_json_value &rhs) const
 

Friends

std::ostream HAZELCAST_API & operator<< (std::ostream &os, const hazelcast_json_value &value)
 

Detailed Description

hazelcast_json_value is a wrapper for Json formatted strings.

It is preferred to store hazelcast_json_value instead of std::string for Json formatted strings. Users can run predicates and use indexes on the attributes of the underlying Json strings.

hazelcast_json_value is queried using Hazelcast's querying language. See query::Predicate.

In terms of querying, numbers in Json strings are treated as either

int64_t

or

double

. Strings, bools and NULL are treated as their C++ counterparts.

hazelcast_json_value keeps given string as it is.

Definition at line 47 of file hazelcast_json_value.h.

Constructor & Destructor Documentation

◆ hazelcast_json_value()

hazelcast::client::hazelcast_json_value::hazelcast_json_value ( std::string  json_string)

Create a hazelcast_json_value from a string.

This method does not the check validity of the underlying Json string. Invalid Json strings may cause wrong results in queries.

Parameters
jsonStringThe json string
Returns
The hazelcast_json_value representing the json string.

Definition at line 48 of file serialization.cpp.

48  : json_string_(std::move(json_string)) {
49  }

Member Function Documentation

◆ to_string()

const std::string & hazelcast::client::hazelcast_json_value::to_string ( ) const

This method returns a Json representation of the object.

Returns
Json string representation of the object

Definition at line 53 of file serialization.cpp.

53  {
54  return json_string_;
55  }

The documentation for this class was generated from the following files: