    

 ## On this page

  

 

 # JsonValue Class Reference

 Last update: 16.07.2025 

Simple wrapper class to jsoncpp that make working with SWIG more convenient. [More...](class_json_value.xhtml#details)

## <a name="pub-methods"></a>Public Member Functions

[JsonValue](class_json_value.xhtml) [\_\_getitem\_\_](class_json_value.xhtml#ade4d9808006de9ef3f214d716f89636a) (string name) Function for reading an objects field in python. [More...](#ade4d9808006de9ef3f214d716f89636a)  
 [JsonValue](class_json_value.xhtml) [\_\_getitem\_\_](class_json_value.xhtml#ad965145dbdc6f10cd40ee2db83ecaa64) (int index) Function for reading an arrays item in python. [More...](#ad965145dbdc6f10cd40ee2db83ecaa64)  
  [\_\_setitem\_\_](class_json_value.xhtml#a4bfd590c72c08313456d1d4d4f0c1100) (string name, [JsonValue](class_json_value.xhtml) v) Destructor. [More...](#a4bfd590c72c08313456d1d4d4f0c1100)  
  [\_\_setitem\_\_](class_json_value.xhtml#a899db9b37cfdc34ca7ae4c0f51727d7e) (int index, [JsonValue](class_json_value.xhtml) v) Function for setting an arrays intem in python. [More...](#a899db9b37cfdc34ca7ae4c0f51727d7e)  
 string [\_\_str\_\_](class_json_value.xhtml#a44139caf93a3463ea4f2a6671cdce842) () Function to print out the [JsonValue](class_json_value.xhtml "Simple wrapper class to jsoncpp that make working with SWIG more convenient. ") in Python. [More...](#a44139caf93a3463ea4f2a6671cdce842)  
 bool [AsBool](class_json_value.xhtml#aaebc45f8b744f2c30703b7f16993a6ec) () Return the JsonObject as a bool. [More...](#aaebc45f8b744f2c30703b7f16993a6ec)  
 number [AsDouble](class_json_value.xhtml#aac7ac2c58a1a2933f6b2208f9b3ae9db) () Return the JsonObject as a number value. [More...](#aac7ac2c58a1a2933f6b2208f9b3ae9db)  
 int [AsInt](class_json_value.xhtml#a36cdae343794112e89c5634c945dda96) () Return the JsonObject as an integer. [More...](#a36cdae343794112e89c5634c945dda96)  
 string [AsString](class_json_value.xhtml#afb0cb51aaa92f311621daed306530e97) () Return the JsonObject as a string. [More...](#afb0cb51aaa92f311621daed306530e97)  
 number [AsUInt](class_json_value.xhtml#ad3d35a3fcb15a0eb151833f690f8bd27) () Return the JsonObject as an numbereger. [More...](#ad3d35a3fcb15a0eb151833f690f8bd27)  
 bool [isObject](class_json_value.xhtml#aacf1348d3094868c0c91d3d07e1f794c) () Return if the [JsonValue](class_json_value.xhtml "Simple wrapper class to jsoncpp that make working with SWIG more convenient. ") is an object. [More...](#aacf1348d3094868c0c91d3d07e1f794c)  
 <a id="a06d2ac4170c04bc72eff58405b9b8a1b"></a> [JsonValue](class_json_value.xhtml#a06d2ac4170c04bc72eff58405b9b8a1b) () Constructor.   
 int [Size](class_json_value.xhtml#af40990b9bd3d70d30e8ce7cdda1ad56f) () The size of the Json object. [More...](#af40990b9bd3d70d30e8ce7cdda1ad56f)  
 <a id="details" name="details"></a>## Detailed Description

Simple wrapper class to jsoncpp that make working with SWIG more convenient.



## Member Function Documentation

<a id="ade4d9808006de9ef3f214d716f89636a"></a>## [◆ ](#ade4d9808006de9ef3f214d716f89636a)\_\_getitem\_\_() \[1/2\]

 [JsonValue](class_json_value.xhtml) \_\_getitem\_\_  ( string  *name*) 

Function for reading an objects field in python.

Parameters nameThe name of the item ReturnsThe fields value 



<a id="ad965145dbdc6f10cd40ee2db83ecaa64"></a>## [◆ ](#ad965145dbdc6f10cd40ee2db83ecaa64)\_\_getitem\_\_() \[2/2\]

 [JsonValue](class_json_value.xhtml) \_\_getitem\_\_  ( int  *index*) 

Function for reading an arrays item in python.

Parameters nameThe index of the item in the array ReturnsThe items value 



<a id="a4bfd590c72c08313456d1d4d4f0c1100"></a>## [◆ ](#a4bfd590c72c08313456d1d4d4f0c1100)\_\_setitem\_\_() \[1/2\]

 \_\_setitem\_\_  ( string  *name*,    [JsonValue](class_json_value.xhtml)  *v*   ) 

Destructor.

Function for setting an objects field in python

Parameters nameThe name of the objects field vThe value to set the field to 



<a id="a899db9b37cfdc34ca7ae4c0f51727d7e"></a>## [◆ ](#a899db9b37cfdc34ca7ae4c0f51727d7e)\_\_setitem\_\_() \[2/2\]

 \_\_setitem\_\_  ( int  *index*,    [JsonValue](class_json_value.xhtml)  *v*   ) 

Function for setting an arrays intem in python.

Parameters nameThe index of the arrays item vThe value to set the item to 



<a id="a44139caf93a3463ea4f2a6671cdce842"></a>## [◆ ](#a44139caf93a3463ea4f2a6671cdce842)\_\_str\_\_()

 string \_\_str\_\_  ( ) 

Function to print out the [JsonValue](class_json_value.xhtml "Simple wrapper class to jsoncpp that make working with SWIG more convenient. ") in Python.

ReturnsThe string containg the JsonValues representation. 



<a id="aaebc45f8b744f2c30703b7f16993a6ec"></a>## [◆ ](#aaebc45f8b744f2c30703b7f16993a6ec)AsBool()

 bool AsBool  ( ) 

Return the JsonObject as a bool.

ReturnsA bool 



<a id="aac7ac2c58a1a2933f6b2208f9b3ae9db"></a>## [◆ ](#aac7ac2c58a1a2933f6b2208f9b3ae9db)AsDouble()

 number AsDouble  ( ) 

Return the JsonObject as a number value.

ReturnsA number value 



<a id="a36cdae343794112e89c5634c945dda96"></a>## [◆ ](#a36cdae343794112e89c5634c945dda96)AsInt()

 int AsInt  ( ) 

Return the JsonObject as an integer.

ReturnsAn integer 



<a id="afb0cb51aaa92f311621daed306530e97"></a>## [◆ ](#afb0cb51aaa92f311621daed306530e97)AsString()

 string AsString  ( ) 

Return the JsonObject as a string.

ReturnsA string 



<a id="ad3d35a3fcb15a0eb151833f690f8bd27"></a>## [◆ ](#ad3d35a3fcb15a0eb151833f690f8bd27)AsUInt()

 number AsUInt  ( ) 

Return the JsonObject as an numbereger.

ReturnsAn numbereger 



<a id="aacf1348d3094868c0c91d3d07e1f794c"></a>## [◆ ](#aacf1348d3094868c0c91d3d07e1f794c)isObject()

 bool isObject  ( ) 

Return if the [JsonValue](class_json_value.xhtml "Simple wrapper class to jsoncpp that make working with SWIG more convenient. ") is an object.

ReturnsTrue iff the [JsonValue](class_json_value.xhtml "Simple wrapper class to jsoncpp that make working with SWIG more convenient. ") is an object 



<a id="af40990b9bd3d70d30e8ce7cdda1ad56f"></a>## [◆ ](#af40990b9bd3d70d30e8ce7cdda1ad56f)Size()

 int Size  ( ) 

The size of the Json object.

ReturnsThe objects size