helayers::JsonSubtree Class Reference

A class to represent a subtree (node and its children) of a JSON tree. More...

#include <JsonSubtree.h>

Public Member Functions

JsonSubtree getChild (const std::string &key) const
 Get a subtree of a chile node. More...
 
std::vector< JsonSubtreegetArrayChild (const std::string &key) const
 For a chile node that's an array, get an array of subtrees, each corresponds to an inner node in the child array. More...
 
std::vector< int > getIntArray (const std::string &key) const
 For a chile node that's an array, get an array with all the integer elements within the child array. More...
 
std::string getString (const std::string &key="") const
 Retrieves a string value by key name, or a path containing several keys delimited by . More...
 
int getInt (const std::string &key="") const
 Retrieves an integer value by key name, or a path containing several keys delimited by . More...
 
double getDouble (const std::string &key="") const
 Retrieves an double value by key name, or a path containing several keys delimited by . More...
 
bool doesChildExist (const std::string &key) const
 Returns an indication for whether a child node exists under the specified key. More...
 
bool doesStringExist (const std::string &key="") const
 Returns an indication for whether a value exists under the specified key, that can be interpreted as a string. More...
 
bool doesIntExist (const std::string &key="") const
 Returns an indication for whether a value exists under the specified key, that can be interpreted as an integer. More...
 
bool doesDoubleExist (const std::string &key="") const
 Returns an indication for whether a value exists under the specified key, that can be interpreted as a double-typed number. More...
 

Friends

class JsonWrapper
 

Detailed Description

A class to represent a subtree (node and its children) of a JSON tree.

Member Function Documentation

◆ doesChildExist()

bool helayers::JsonSubtree::doesChildExist ( const std::string &  key) const

Returns an indication for whether a child node exists under the specified key.

Parameters
[in]keykey name or path delimited by .

◆ doesDoubleExist()

bool helayers::JsonSubtree::doesDoubleExist ( const std::string &  key = "") const

Returns an indication for whether a value exists under the specified key, that can be interpreted as a double-typed number.

Parameters
[in]keykey name or path delimited by .

◆ doesIntExist()

bool helayers::JsonSubtree::doesIntExist ( const std::string &  key = "") const

Returns an indication for whether a value exists under the specified key, that can be interpreted as an integer.

Parameters
[in]keykey name or path delimited by .

◆ doesStringExist()

bool helayers::JsonSubtree::doesStringExist ( const std::string &  key = "") const

Returns an indication for whether a value exists under the specified key, that can be interpreted as a string.

Parameters
[in]keykey name or path delimited by .

◆ getArrayChild()

std::vector< JsonSubtree > helayers::JsonSubtree::getArrayChild ( const std::string &  key) const

For a chile node that's an array, get an array of subtrees, each corresponds to an inner node in the child array.

Parameters
[in]keykey name or path delimited by .

◆ getChild()

JsonSubtree helayers::JsonSubtree::getChild ( const std::string &  key) const

Get a subtree of a chile node.

Parameters
[in]keykey name or path delimited by .

◆ getDouble()

double helayers::JsonSubtree::getDouble ( const std::string &  key = "") const

Retrieves an double value by key name, or a path containing several keys delimited by .

Parameters
[in]keykey name or path delimited by .

◆ getInt()

int helayers::JsonSubtree::getInt ( const std::string &  key = "") const

Retrieves an integer value by key name, or a path containing several keys delimited by .

Parameters
[in]keykey name or path delimited by .

◆ getIntArray()

std::vector< int > helayers::JsonSubtree::getIntArray ( const std::string &  key) const

For a chile node that's an array, get an array with all the integer elements within the child array.

If the array contains elements other than integers these elements will be ignored

Parameters
[in]keykey name or path delimited by .

◆ getString()

string helayers::JsonSubtree::getString ( const std::string &  key = "") const

Retrieves a string value by key name, or a path containing several keys delimited by .

Parameters
[in]keykey name or path delimited by .

The documentation for this class was generated from the following files:
  • /opt/IBM/FHE-distro/ML-HElib/src/helayers/hebase/utils/JsonSubtree.h
  • /opt/IBM/FHE-distro/ML-HElib/src/helayers/hebase/utils/JsonSubtree.cpp