Public Member Functions | List of all members
cudf::get_json_object_options Class Reference

Settings for get_json_object(). More...

#include <json.hpp>

Public Member Functions

 get_json_object_options ()=default
 Default constructor.
 
CUDF_HOST_DEVICE bool get_allow_single_quotes () const
 Returns true/false depending on whether single-quotes for representing strings are allowed. More...
 
CUDF_HOST_DEVICE bool get_strip_quotes_from_single_strings () const
 Returns true/false depending on whether individually returned string values have their quotes stripped. More...
 
CUDF_HOST_DEVICE bool get_missing_fields_as_nulls () const
 Whether a field not contained by an object is to be interpreted as null. More...
 
void set_allow_single_quotes (bool _allow_single_quotes)
 Set whether single-quotes for strings are allowed. More...
 
void set_strip_quotes_from_single_strings (bool _strip_quotes_from_single_strings)
 Set whether individually returned string values have their quotes stripped. More...
 
void set_missing_fields_as_nulls (bool _missing_fields_as_nulls)
 Set whether missing fields are interpreted as null. More...
 

Detailed Description

Settings for get_json_object().

Definition at line 38 of file json/json.hpp.

Member Function Documentation

◆ get_allow_single_quotes()

CUDF_HOST_DEVICE bool cudf::get_json_object_options::get_allow_single_quotes ( ) const
inline

Returns true/false depending on whether single-quotes for representing strings are allowed.

Returns
true if single-quotes are allowed, false otherwise.

Definition at line 60 of file json/json.hpp.

◆ get_missing_fields_as_nulls()

CUDF_HOST_DEVICE bool cudf::get_json_object_options::get_missing_fields_as_nulls ( ) const
inline

Whether a field not contained by an object is to be interpreted as null.

When set to true, if an object is queried for a field it does not contain, a null is returned.

With missing_fields_as_nulls OFF:
Input = {"a" : [{"x": "1", "y": "2"}, {"x": "3"}]}
Query = $.a[*].y
Output = ["2"]
With missing_fields_as_nulls ON:
Input = {"a" : [{"x": "1", "y": "2"}, {"x": "3"}]}
Query = $.a[*].y
Output = ["2", null]
Returns
true if missing fields are interpreted as null.

Definition at line 115 of file json/json.hpp.

◆ get_strip_quotes_from_single_strings()

CUDF_HOST_DEVICE bool cudf::get_json_object_options::get_strip_quotes_from_single_strings ( ) const
inline

Returns true/false depending on whether individually returned string values have their quotes stripped.

When set to true, if the return value for a given row is an individual string (not an object, or an array of strings), strip the quotes from the string and return only the contents of the string itself. Example:

With strip_quotes_from_single_strings OFF:
Input = {"a" : "b"}
Query = $.a
Output = "b"
With strip_quotes_from_single_strings ON:
Input = {"a" : "b"}
Query = $.a
Output = b
Returns
true if individually returned string values have their quotes stripped.

Definition at line 89 of file json/json.hpp.

◆ set_allow_single_quotes()

void cudf::get_json_object_options::set_allow_single_quotes ( bool  _allow_single_quotes)
inline

Set whether single-quotes for strings are allowed.

Parameters
_allow_single_quotesbool indicating desired behavior.

Definition at line 125 of file json/json.hpp.

◆ set_missing_fields_as_nulls()

void cudf::get_json_object_options::set_missing_fields_as_nulls ( bool  _missing_fields_as_nulls)
inline

Set whether missing fields are interpreted as null.

Parameters
_missing_fields_as_nullsbool indicating desired behavior.

Definition at line 145 of file json/json.hpp.

◆ set_strip_quotes_from_single_strings()

void cudf::get_json_object_options::set_strip_quotes_from_single_strings ( bool  _strip_quotes_from_single_strings)
inline

Set whether individually returned string values have their quotes stripped.

Parameters
_strip_quotes_from_single_stringsbool indicating desired behavior.

Definition at line 135 of file json/json.hpp.


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