IDA C++ SDK 9.2
Loading...
Searching...
No Matches
jobj_t Struct Reference

#include <parsejson.hpp>

Inheritance diagram for jobj_t:
qvector< kvp_t >

Public Member Functions

bool has_value (const char *k) const
jvalue_t * get_value (const char *k, jtype_t t=JT_UNKNOWN)
const jvalue_t * get_value (const char *k, jtype_t t=JT_UNKNOWN) const
const jvalue_t * get_value_or_fail (const char *k, jtype_t t=JT_UNKNOWN) const
jvalue_t * get_value_or_new (const char *key)
bool del_value (const char *k)
int64 get_num (const char *k) const
bool get_bool (const char *k) const
double get_double (const char *k) const
const char * get_str (const char *k) const
const jobj_tget_obj (const char *k) const
const jarr_tget_arr (const char *k) const
 DEFINE_ACCESSORS (int, int, JT_NUM, v->num(), v->set_num(value))
 DEFINE_ACCESSORS (int64, int64, JT_NUM, v->num(), v->set_num(value))
 DEFINE_ACCESSORS (double, double, JT_DBL, v->vdouble(), v->set_double(value))
 DEFINE_ACCESSORS (bool, bool, JT_BOOL, v->vbool(), v->set_bool(value))
 DEFINE_ACCESSORS (jarr_t *, const jarr_t *, JT_ARR, &v->arr(), v->set_arr(value))
 DEFINE_ACCESSORS (jobj_t *, const jobj_t *, JT_OBJ, &v->obj(), v->set_obj(value))
 DEFINE_ACCESSORS (const char *, const char *, JT_STR, v->str(), v->set_str(new qstring(value)))
bool get (qstring *out, const char *k) const
const qstringget (const char *k, const qstring &dflt) const
void put (const char *key, const qstring &value)
void put (const char *key, const jobj_t &value)
Public Member Functions inherited from qvector< kvp_t >
 qvector (void)
 Constructor.
 ~qvector (void)
 Destructor.
 DEFINE_MEMORY_ALLOCATION_FUNCS () void push_back(const kvp_t &x)
 Append a new element to the end the qvector.
void push_back (kvp_t &&x)
 Append a new element to the end the qvector with a move semantics.
void emplace_back (Args &&... args)
 Construct and append a new element to the end the qvector with a forwarding semantics.
void pop_back (void)
 Remove the last element in the qvector.
size_t size (void) const
 Get the number of elements in the qvector.
bool empty (void) const
 Does the qvector have 0 elements?
const kvp_toperator[] (size_t _idx) const
 Allows use of typical c-style array indexing for qvectors.
const kvp_tat (size_t _idx) const
 Get element at index '_idx'.
const kvp_tfront (void) const
 Get the first element in the qvector.
const kvp_tback (void) const
 Get the last element in the qvector.
void qclear (void)
 Destroy all elements but do not free memory.
void clear (void)
 Destroy all elements and free memory.
qvector< kvp_t > & operator= (const qvector< kvp_t > &x)
 Allow assignment of one qvector to another using '='.
void resize (size_t _newsize, const kvp_t &x)
 Resize to the given size.
void resize_noinit (size_t _newsize)
void grow (const kvp_t &x=kvp_t())
 Add an element to the end of the qvector, which will be a new T() if x is not given.
size_t capacity (void) const
 Get the number of elements that this qvector can contain - not the same as the number of elements currently in the qvector (size())
void reserve (size_t cnt)
 Increase the capacity of the qvector.
void truncate (void)
 Shrink the capacity down to the current number of elements.
void swap (qvector< kvp_t > &r) noexcept
 Replace all attributes of this qvector with that of 'r', and vice versa.
kvp_textract (void)
 Empty the qvector and return a pointer to it's contents.
void inject (kvp_t *s, size_t len)
 Populate the qvector with dynamic memory.
bool operator== (const qvector< kvp_t > &r) const
 Allow ability to test the equality of two qvectors using '=='.
bool operator!= (const qvector< kvp_t > &r) const
 Allow ability to test equality of two qvectors using '!='.
iterator begin (void)
 Get an iterator that points to the first element in the qvector.
iterator end (void)
 Get an iterator that points to the end of the qvector (NOT the last element)
iterator insert (iterator it, const kvp_t &x)
 Insert an element into the qvector at a specified position.
iterator erase (iterator it)
 Remove an element from the qvector.
iterator find (const kvp_t &x)
 Find an element in the qvector.
ssize_t index (const kvp_t &x) const
 Find index of the specified value or return -1.
void add (const kvp_t &x)
 Add an element to the end of the qvector.
bool has (const kvp_t &x) const
 Does the qvector contain x?
bool add_unique (const kvp_t &x)
 Add an element to the end of the qvector - only if it isn't already present.
bool del (const kvp_t &x)
 Find an element and remove it.
const char * dstr (void) const

Additional Inherited Members

Public Types inherited from qvector< kvp_t >
typedef kvp_t value_type
 the type of objects contained in this qvector
typedef kvp_titerator
typedef const kvp_tconst_iterator

Member Function Documentation

◆ has_value()

bool jobj_t::has_value ( const char * k) const
inline

◆ get_value() [1/2]

jvalue_t * jobj_t::get_value ( const char * k,
jtype_t t = JT_UNKNOWN )
inline

◆ get_value() [2/2]

const jvalue_t * jobj_t::get_value ( const char * k,
jtype_t t = JT_UNKNOWN ) const
inline

◆ get_value_or_fail()

const jvalue_t * jobj_t::get_value_or_fail ( const char * k,
jtype_t t = JT_UNKNOWN ) const
inline

◆ get_value_or_new()

jvalue_t * jobj_t::get_value_or_new ( const char * key)
inline

◆ del_value()

bool jobj_t::del_value ( const char * k)
inline

◆ get_num()

int64 jobj_t::get_num ( const char * k) const
inline

◆ get_bool()

bool jobj_t::get_bool ( const char * k) const
inline

◆ get_double()

double jobj_t::get_double ( const char * k) const
inline

◆ get_str()

const char * jobj_t::get_str ( const char * k) const
inline

◆ get_obj()

const jobj_t & jobj_t::get_obj ( const char * k) const
inline

◆ get_arr()

const jarr_t & jobj_t::get_arr ( const char * k) const
inline

◆ DEFINE_ACCESSORS() [1/7]

jobj_t::DEFINE_ACCESSORS ( int ,
int ,
JT_NUM ,
v-> num(),
v-> set_numvalue )

◆ DEFINE_ACCESSORS() [2/7]

jobj_t::DEFINE_ACCESSORS ( int64 ,
int64 ,
JT_NUM ,
v-> num(),
v-> set_numvalue )

◆ DEFINE_ACCESSORS() [3/7]

jobj_t::DEFINE_ACCESSORS ( double ,
double ,
JT_DBL ,
v-> vdouble(),
v-> set_doublevalue )

◆ DEFINE_ACCESSORS() [4/7]

jobj_t::DEFINE_ACCESSORS ( bool ,
bool ,
JT_BOOL ,
v-> vbool(),
v-> set_boolvalue )

◆ DEFINE_ACCESSORS() [5/7]

jobj_t::DEFINE_ACCESSORS ( jarr_t * ,
const jarr_t * ,
JT_ARR ,
&v-> arr(),
v-> set_arrvalue )

◆ DEFINE_ACCESSORS() [6/7]

jobj_t::DEFINE_ACCESSORS ( jobj_t * ,
const jobj_t * ,
JT_OBJ ,
&v-> obj(),
v-> set_objvalue )

◆ DEFINE_ACCESSORS() [7/7]

jobj_t::DEFINE_ACCESSORS ( const char * ,
const char * ,
JT_STR ,
v-> str(),
v-> set_strnew qstring(value) )

◆ get() [1/2]

bool jobj_t::get ( qstring * out,
const char * k ) const
inline

◆ get() [2/2]

const qstring & jobj_t::get ( const char * k,
const qstring & dflt ) const
inline

◆ put() [1/2]

void jobj_t::put ( const char * key,
const qstring & value )
inline

◆ put() [2/2]

void jobj_t::put ( const char * key,
const jobj_t & value )
inline

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