Hazelcast C++ Client
Public Member Functions | Friends | List of all members
hazelcast::client::HazelcastJsonValue Class Reference

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

#include <HazelcastJsonValue.h>

Public Member Functions

 HazelcastJsonValue (const std::string &jsonString)
 Create a HazelcastJsonValue from a string. More...
 
const std::string & toString () const
 This method returns a Json representation of the object. More...
 
bool operator== (const HazelcastJsonValue &rhs) const
 
bool operator!= (const HazelcastJsonValue &rhs) const
 

Friends

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

Detailed Description

HazelcastJsonValue is a wrapper for Json formatted strings.

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

HazelcastJsonValue 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.

HazelcastJsonValue keeps given string as it is.

Constructor & Destructor Documentation

◆ HazelcastJsonValue()

hazelcast::client::HazelcastJsonValue::HazelcastJsonValue ( const std::string &  jsonString)

Create a HazelcastJsonValue 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 HazelcastJsonValue representing the json string.

Member Function Documentation

◆ toString()

const std::string & hazelcast::client::HazelcastJsonValue::toString ( ) const

This method returns a Json representation of the object.

Returns
Json string representation of the object

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