SDTS_AL
Public Member Functions | Friends | List of all members
CPLJSONArray Class Reference

The JSONArray class JSON array from JSONDocument. More...

#include <cpl_json.h>

Inheritance diagram for CPLJSONArray:
CPLJSONObject

Public Member Functions

int Size () const
 
void Add (const CPLJSONObject &oValue)
 
void Add (const std::string &osValue)
 
void Add (const char *pszValue)
 
void Add (double dfValue)
 
void Add (int nValue)
 
void Add (GInt64 nValue)
 
void Add (bool bValue)
 
CPLJSONObject operator[] (int nIndex)
 
const CPLJSONObject operator[] (int nIndex) const
 
- Public Member Functions inherited from CPLJSONObject
void Add (const std::string &osName, const std::string &osValue)
 
void Add (const std::string &osName, const char *pszValue)
 
void Add (const std::string &osName, double dfValue)
 
void Add (const std::string &osName, int nValue)
 
void Add (const std::string &osName, GInt64 nValue)
 
void Add (const std::string &osName, const CPLJSONArray &oValue)
 
void Add (const std::string &osName, const CPLJSONObject &oValue)
 
void Add (const std::string &osName, bool bValue)
 
void AddNull (const std::string &osName)
 
void Set (const std::string &osName, const std::string &osValue)
 
void Set (const std::string &osName, const char *pszValue)
 
void Set (const std::string &osName, double dfValue)
 
void Set (const std::string &osName, int nValue)
 
void Set (const std::string &osName, GInt64 nValue)
 
void Set (const std::string &osName, bool bValue)
 
void SetNull (const std::string &osName)
 
std::string GetString (const std::string &osName, const std::string &osDefault="") const
 
double GetDouble (const std::string &osName, double dfDefault=0.0) const
 
int GetInteger (const std::string &osName, int nDefault=0) const
 
GInt64 GetLong (const std::string &osName, GInt64 nDefault=0) const
 
bool GetBool (const std::string &osName, bool bDefault=false) const
 
std::string ToString (const std::string &osDefault="") const
 
double ToDouble (double dfDefault=0.0) const
 
int ToInteger (int nDefault=0) const
 
GInt64 ToLong (GInt64 nDefault=0) const
 
bool ToBool (bool bDefault=false) const
 
CPLJSONArray ToArray () const
 
std::string Format (enum PrettyFormat eFormat) const
 
void Delete (const std::string &osName)
 
CPLJSONArray GetArray (const std::string &osName) const
 
CPLJSONObject GetObj (const std::string &osName) const
 
CPLJSONObject operator[] (const std::string &osName) const
 
enum Type GetType () const
 
std::vector< CPLJSONObjectGetChildren () const
 Get json object children. More...
 
bool IsValid () const
 
void Deinit ()
 

Friends

class CPLJSONObject
 
class CPLJSONDocument
 

Additional Inherited Members

- Public Types inherited from CPLJSONObject
enum  Type
 
enum  PrettyFormat { Plain, Spaced, Pretty }
 

Detailed Description

The JSONArray class JSON array from JSONDocument.

Member Function Documentation

◆ Add() [1/7]

void CPLJSONArray::Add ( bool  bValue)

Add value to array

Parameters
bValueValue to add.
Since
GDAL 2.3

◆ Add() [2/7]

void CPLJSONArray::Add ( const char *  pszValue)

Add value to array

Parameters
pszValueValue to add.
Since
GDAL 2.3

◆ Add() [3/7]

void CPLJSONArray::Add ( const CPLJSONObject oValue)

Add json object to array.

Parameters
oValueJson array.
Since
GDAL 2.3

◆ Add() [4/7]

void CPLJSONArray::Add ( const std::string &  osValue)

Add value to array

Parameters
osValueValue to add.
Since
GDAL 2.3

◆ Add() [5/7]

void CPLJSONArray::Add ( double  dfValue)

Add value to array

Parameters
dfValueValue to add.
Since
GDAL 2.3

◆ Add() [6/7]

void CPLJSONArray::Add ( GInt64  nValue)

Add value to array

Parameters
nValueValue to add.
Since
GDAL 2.3

◆ Add() [7/7]

void CPLJSONArray::Add ( int  nValue)

Add value to array

Parameters
nValueValue to add.
Since
GDAL 2.3

◆ operator[]() [1/2]

CPLJSONObject CPLJSONArray::operator[] ( int  nIndex)

Get array item by index.

Parameters
nIndexItem index.
Returns
Json object.
Since
GDAL 2.3

◆ operator[]() [2/2]

const CPLJSONObject CPLJSONArray::operator[] ( int  nIndex) const

Get array const item by index.

Parameters
nIndexItem index.
Returns
Json object.
Since
GDAL 2.3

◆ Size()

int CPLJSONArray::Size ( ) const

Get array size.

Returns
Array size.
Since
GDAL 2.3

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