Bitcoin
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
UniValue Class Reference

#include <univalue.h>

Public Types

enum  VType {
  VNULL, VOBJ, VARR, VSTR,
  VNUM, VBOOL
}
 

Public Member Functions

 UniValue ()
 
 UniValue (UniValue::VType initialType, const std::string &initialStr="")
 
 UniValue (uint64_t val_)
 
 UniValue (int64_t val_)
 
 UniValue (bool val_)
 
 UniValue (int val_)
 
 UniValue (double val_)
 
 UniValue (const std::string &val_)
 
 UniValue (const char *val_)
 
 ~UniValue ()
 
void clear ()
 
bool setNull ()
 
bool setBool (bool val)
 
bool setNumStr (const std::string &val)
 
bool setInt (uint64_t val)
 
bool setInt (int64_t val)
 
bool setInt (int val_)
 
bool setFloat (double val)
 
bool setStr (const std::string &val)
 
bool setArray ()
 
bool setObject ()
 
enum VType getType () const
 
const std::string & getValStr () const
 
bool empty () const
 
size_t size () const
 
bool getBool () const
 
void getObjMap (std::map< std::string, UniValue > &kv) const
 
bool checkObject (const std::map< std::string, UniValue::VType > &memberTypes) const
 
const UniValueoperator[] (const std::string &key) const
 
const UniValueoperator[] (size_t index) const
 
bool exists (const std::string &key) const
 
bool isNull () const
 
bool isTrue () const
 
bool isFalse () const
 
bool isBool () const
 
bool isStr () const
 
bool isNum () const
 
bool isArray () const
 
bool isObject () const
 
bool push_back (const UniValue &val)
 
bool push_back (const std::string &val_)
 
bool push_back (const char *val_)
 
bool push_back (uint64_t val_)
 
bool push_back (int64_t val_)
 
bool push_back (int val_)
 
bool push_back (double val_)
 
bool push_backV (const std::vector< UniValue > &vec)
 
void __pushKV (const std::string &key, const UniValue &val)
 
bool pushKV (const std::string &key, const UniValue &val)
 
bool pushKV (const std::string &key, const std::string &val_)
 
bool pushKV (const std::string &key, const char *val_)
 
bool pushKV (const std::string &key, int64_t val_)
 
bool pushKV (const std::string &key, uint64_t val_)
 
bool pushKV (const std::string &key, bool val_)
 
bool pushKV (const std::string &key, int val_)
 
bool pushKV (const std::string &key, double val_)
 
bool pushKVs (const UniValue &obj)
 
std::string write (unsigned int prettyIndent=0, unsigned int indentLevel=0) const
 
bool read (const char *raw, size_t len)
 
bool read (const char *raw)
 
bool read (const std::string &rawStr)
 
const std::vector< std::string > & getKeys () const
 
const std::vector< UniValue > & getValues () const
 
bool get_bool () const
 
const std::string & get_str () const
 
int get_int () const
 
int64_t get_int64 () const
 
double get_real () const
 
const UniValueget_obj () const
 
const UniValueget_array () const
 
enum VType type () const
 

Private Member Functions

bool findKey (const std::string &key, size_t &retIdx) const
 
void writeArray (unsigned int prettyIndent, unsigned int indentLevel, std::string &s) const
 
void writeObject (unsigned int prettyIndent, unsigned int indentLevel, std::string &s) const
 

Private Attributes

UniValue::VType typ
 
std::string val
 
std::vector< std::string > keys
 
std::vector< UniValuevalues
 

Friends

const UniValuefind_value (const UniValue &obj, const std::string &name)
 

Member Enumeration Documentation

◆ VType

Enumerator
VNULL 
VOBJ 
VARR 
VSTR 
VNUM 
VBOOL 

Constructor & Destructor Documentation

◆ UniValue() [1/9]

UniValue::UniValue ( )
inline

◆ UniValue() [2/9]

UniValue::UniValue ( UniValue::VType  initialType,
const std::string &  initialStr = "" 
)
inline

◆ UniValue() [3/9]

UniValue::UniValue ( uint64_t  val_)
inline

◆ UniValue() [4/9]

UniValue::UniValue ( int64_t  val_)
inline

◆ UniValue() [5/9]

UniValue::UniValue ( bool  val_)
inline

◆ UniValue() [6/9]

UniValue::UniValue ( int  val_)
inline

◆ UniValue() [7/9]

UniValue::UniValue ( double  val_)
inline

◆ UniValue() [8/9]

UniValue::UniValue ( const std::string &  val_)
inline

◆ UniValue() [9/9]

UniValue::UniValue ( const char *  val_)
inline

◆ ~UniValue()

UniValue::~UniValue ( )
inline

Member Function Documentation

◆ __pushKV()

void UniValue::__pushKV ( const std::string &  key,
const UniValue val 
)

◆ checkObject()

bool UniValue::checkObject ( const std::map< std::string, UniValue::VType > &  memberTypes) const

◆ clear()

void UniValue::clear ( )

◆ empty()

bool UniValue::empty ( ) const
inline

◆ exists()

bool UniValue::exists ( const std::string &  key) const
inline

◆ findKey()

bool UniValue::findKey ( const std::string &  key,
size_t &  retIdx 
) const
private

◆ get_array()

const UniValue & UniValue::get_array ( ) const

◆ get_bool()

bool UniValue::get_bool ( ) const

◆ get_int()

int UniValue::get_int ( ) const

◆ get_int64()

int64_t UniValue::get_int64 ( ) const

◆ get_obj()

const UniValue & UniValue::get_obj ( ) const

◆ get_real()

double UniValue::get_real ( ) const

◆ get_str()

const std::string & UniValue::get_str ( ) const

◆ getBool()

bool UniValue::getBool ( ) const
inline

◆ getKeys()

const std::vector< std::string > & UniValue::getKeys ( ) const

◆ getObjMap()

void UniValue::getObjMap ( std::map< std::string, UniValue > &  kv) const

◆ getType()

enum VType UniValue::getType ( ) const
inline

◆ getValStr()

const std::string& UniValue::getValStr ( ) const
inline

◆ getValues()

const std::vector< UniValue > & UniValue::getValues ( ) const

◆ isArray()

bool UniValue::isArray ( ) const
inline

◆ isBool()

bool UniValue::isBool ( ) const
inline

◆ isFalse()

bool UniValue::isFalse ( ) const
inline

◆ isNull()

bool UniValue::isNull ( ) const
inline

◆ isNum()

bool UniValue::isNum ( ) const
inline

◆ isObject()

bool UniValue::isObject ( ) const
inline

◆ isStr()

bool UniValue::isStr ( ) const
inline

◆ isTrue()

bool UniValue::isTrue ( ) const
inline

◆ operator[]() [1/2]

const UniValue & UniValue::operator[] ( const std::string &  key) const

◆ operator[]() [2/2]

const UniValue & UniValue::operator[] ( size_t  index) const

◆ push_back() [1/7]

bool UniValue::push_back ( const UniValue val)

◆ push_back() [2/7]

bool UniValue::push_back ( const std::string &  val_)
inline

◆ push_back() [3/7]

bool UniValue::push_back ( const char *  val_)
inline

◆ push_back() [4/7]

bool UniValue::push_back ( uint64_t  val_)
inline

◆ push_back() [5/7]

bool UniValue::push_back ( int64_t  val_)
inline

◆ push_back() [6/7]

bool UniValue::push_back ( int  val_)
inline

◆ push_back() [7/7]

bool UniValue::push_back ( double  val_)
inline

◆ push_backV()

bool UniValue::push_backV ( const std::vector< UniValue > &  vec)

◆ pushKV() [1/8]

bool UniValue::pushKV ( const std::string &  key,
const UniValue val 
)

◆ pushKV() [2/8]

bool UniValue::pushKV ( const std::string &  key,
const std::string &  val_ 
)
inline

◆ pushKV() [3/8]

bool UniValue::pushKV ( const std::string &  key,
const char *  val_ 
)
inline

◆ pushKV() [4/8]

bool UniValue::pushKV ( const std::string &  key,
int64_t  val_ 
)
inline

◆ pushKV() [5/8]

bool UniValue::pushKV ( const std::string &  key,
uint64_t  val_ 
)
inline

◆ pushKV() [6/8]

bool UniValue::pushKV ( const std::string &  key,
bool  val_ 
)
inline

◆ pushKV() [7/8]

bool UniValue::pushKV ( const std::string &  key,
int  val_ 
)
inline

◆ pushKV() [8/8]

bool UniValue::pushKV ( const std::string &  key,
double  val_ 
)
inline

◆ pushKVs()

bool UniValue::pushKVs ( const UniValue obj)

◆ read() [1/3]

bool UniValue::read ( const char *  raw,
size_t  len 
)

◆ read() [2/3]

bool UniValue::read ( const char *  raw)
inline

◆ read() [3/3]

bool UniValue::read ( const std::string &  rawStr)
inline

◆ setArray()

bool UniValue::setArray ( )

◆ setBool()

bool UniValue::setBool ( bool  val)

◆ setFloat()

bool UniValue::setFloat ( double  val)

◆ setInt() [1/3]

bool UniValue::setInt ( uint64_t  val)

◆ setInt() [2/3]

bool UniValue::setInt ( int64_t  val)

◆ setInt() [3/3]

bool UniValue::setInt ( int  val_)
inline

◆ setNull()

bool UniValue::setNull ( )

◆ setNumStr()

bool UniValue::setNumStr ( const std::string &  val)

◆ setObject()

bool UniValue::setObject ( )

◆ setStr()

bool UniValue::setStr ( const std::string &  val)

◆ size()

size_t UniValue::size ( ) const
inline

◆ type()

enum VType UniValue::type ( ) const
inline

◆ write()

std::string UniValue::write ( unsigned int  prettyIndent = 0,
unsigned int  indentLevel = 0 
) const

◆ writeArray()

void UniValue::writeArray ( unsigned int  prettyIndent,
unsigned int  indentLevel,
std::string &  s 
) const
private

◆ writeObject()

void UniValue::writeObject ( unsigned int  prettyIndent,
unsigned int  indentLevel,
std::string &  s 
) const
private

Friends And Related Function Documentation

◆ find_value

const UniValue& find_value ( const UniValue obj,
const std::string &  name 
)
friend

Member Data Documentation

◆ keys

std::vector<std::string> UniValue::keys
private

◆ typ

UniValue::VType UniValue::typ
private

◆ val

std::string UniValue::val
private

◆ values

std::vector<UniValue> UniValue::values
private

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