Dash Core  0.12.2.1
P2P Digital Currency
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
 
bool checkObject (const std::map< std::string, UniValue::VType > &memberTypes)
 
const UniValueoperator[] (const std::string &key) const
 
const UniValueoperator[] (unsigned int 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_backV (const std::vector< UniValue > &vec)
 
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, 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)
 
bool read (const std::string &rawStr)
 
std::vector< std::string > getKeys () const
 
std::vector< UniValuegetValues () const
 
bool get_bool () 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
 
bool push_back (std::pair< std::string, UniValue > pear)
 

Private Member Functions

int findKey (const std::string &key) 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)
 

Detailed Description

Definition at line 19 of file univalue.h.

Member Enumeration Documentation

◆ VType

Enumerator
VNULL 
VOBJ 
VARR 
VSTR 
VNUM 
VBOOL 

Definition at line 21 of file univalue.h.

Constructor & Destructor Documentation

◆ UniValue() [1/9]

UniValue::UniValue ( )
inline

Definition at line 23 of file univalue.h.

◆ UniValue() [2/9]

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

Definition at line 24 of file univalue.h.

◆ UniValue() [3/9]

UniValue::UniValue ( uint64_t  val_)
inline

Definition at line 28 of file univalue.h.

◆ UniValue() [4/9]

UniValue::UniValue ( int64_t  val_)
inline

Definition at line 31 of file univalue.h.

◆ UniValue() [5/9]

UniValue::UniValue ( bool  val_)
inline

Definition at line 34 of file univalue.h.

◆ UniValue() [6/9]

UniValue::UniValue ( int  val_)
inline

Definition at line 37 of file univalue.h.

◆ UniValue() [7/9]

UniValue::UniValue ( double  val_)
inline

Definition at line 40 of file univalue.h.

◆ UniValue() [8/9]

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

Definition at line 43 of file univalue.h.

◆ UniValue() [9/9]

UniValue::UniValue ( const char *  val_)
inline

Definition at line 46 of file univalue.h.

◆ ~UniValue()

UniValue::~UniValue ( )
inline

Definition at line 50 of file univalue.h.

Member Function Documentation

◆ checkObject()

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

Definition at line 228 of file univalue.cpp.

Referenced by MutateTxSign().

◆ clear()

void UniValue::clear ( )

Definition at line 80 of file univalue.cpp.

Referenced by listtransactions().

◆ empty()

bool UniValue::empty ( ) const
inline

Definition at line 67 of file univalue.h.

Referenced by CallRPC(), CKeePassIntegrator::doHTTPPost(), and signrawtransaction().

◆ exists()

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

Definition at line 75 of file univalue.h.

Referenced by MutateTxSign().

◆ findKey()

int UniValue::findKey ( const std::string &  key) const
private

Definition at line 218 of file univalue.cpp.

Referenced by exists().

◆ get_array()

◆ get_bool()

◆ get_int()

◆ get_int64()

int64_t UniValue::get_int64 ( ) const

◆ get_obj()

const UniValue & UniValue::get_obj ( ) const

◆ get_real()

double UniValue::get_real ( ) const

Definition at line 337 of file univalue.cpp.

Referenced by CProposalValidator::GetDataValue().

◆ get_str()

◆ getBool()

bool UniValue::getBool ( ) const
inline

Definition at line 71 of file univalue.h.

◆ getKeys()

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

Definition at line 289 of file univalue.cpp.

Referenced by createrawtransaction(), and sendmany().

◆ getType()

enum VType UniValue::getType ( ) const
inline

Definition at line 65 of file univalue.h.

Referenced by CProposalValidator::GetDataValue(), read(), and type().

◆ getValStr()

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

Definition at line 66 of file univalue.h.

Referenced by AmountFromValue(), CommandLineRPC(), ParseHashUV(), and ParseHexUV().

◆ getValues()

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

◆ isArray()

bool UniValue::isArray ( ) const
inline

◆ isBool()

bool UniValue::isBool ( ) const
inline

Definition at line 80 of file univalue.h.

◆ isFalse()

bool UniValue::isFalse ( ) const
inline

Definition at line 79 of file univalue.h.

◆ isNull()

◆ isNum()

bool UniValue::isNum ( ) const
inline

◆ isObject()

bool UniValue::isObject ( ) const
inline

◆ isStr()

bool UniValue::isStr ( ) const
inline

◆ isTrue()

bool UniValue::isTrue ( ) const
inline

Definition at line 78 of file univalue.h.

Referenced by getBool(), and setban().

◆ operator[]() [1/2]

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

Definition at line 243 of file univalue.cpp.

◆ operator[]() [2/2]

const UniValue & UniValue::operator[] ( unsigned int  index) const

Definition at line 255 of file univalue.cpp.

◆ push_back() [1/4]

◆ push_back() [2/4]

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

Definition at line 87 of file univalue.h.

◆ push_back() [3/4]

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

Definition at line 91 of file univalue.h.

◆ push_back() [4/4]

bool UniValue::push_back ( std::pair< std::string, UniValue pear)
inline

Definition at line 156 of file univalue.h.

◆ push_backV()

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

Definition at line 185 of file univalue.cpp.

Referenced by listtransactions().

◆ pushKV() [1/7]

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

Definition at line 195 of file univalue.cpp.

Referenced by push_back(), pushKV(), and TxToUniv().

◆ pushKV() [2/7]

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

Definition at line 98 of file univalue.h.

◆ pushKV() [3/7]

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

Definition at line 102 of file univalue.h.

◆ pushKV() [4/7]

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

Definition at line 106 of file univalue.h.

◆ pushKV() [5/7]

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

Definition at line 110 of file univalue.h.

◆ pushKV() [6/7]

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

Definition at line 114 of file univalue.h.

◆ pushKV() [7/7]

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

Definition at line 118 of file univalue.h.

◆ pushKVs()

bool UniValue::pushKVs ( const UniValue obj)

Definition at line 205 of file univalue.cpp.

Referenced by validateaddress().

◆ read() [1/2]

◆ read() [2/2]

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

Definition at line 128 of file univalue.h.

◆ setArray()

bool UniValue::setArray ( )

Definition at line 162 of file univalue.cpp.

Referenced by listtransactions().

◆ setBool()

bool UniValue::setBool ( bool  val)

Definition at line 94 of file univalue.cpp.

Referenced by read(), and UniValue().

◆ setFloat()

bool UniValue::setFloat ( double  val)

Definition at line 142 of file univalue.cpp.

Referenced by UniValue().

◆ setInt() [1/3]

bool UniValue::setInt ( uint64_t  val)

Definition at line 122 of file univalue.cpp.

Referenced by UniValue().

◆ setInt() [2/3]

bool UniValue::setInt ( int64_t  val)

Definition at line 132 of file univalue.cpp.

◆ setInt() [3/3]

bool UniValue::setInt ( int  val)
inline

Definition at line 59 of file univalue.h.

Referenced by setInt().

◆ setNull()

bool UniValue::setNull ( )

Definition at line 88 of file univalue.cpp.

◆ setNumStr()

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

Definition at line 111 of file univalue.cpp.

◆ setObject()

bool UniValue::setObject ( )

Definition at line 169 of file univalue.cpp.

◆ setStr()

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

Definition at line 154 of file univalue.cpp.

Referenced by UniValue().

◆ size()

size_t UniValue::size ( ) const
inline

Definition at line 69 of file univalue.h.

Referenced by _createmultisig_redeemScript(), abandontransaction(), addmultisigaddress(), addnode(), backupwallet(), clearbanned(), createmultisig(), createrawtransaction(), debug(), decoderawtransaction(), decodescript(), disconnectnode(), dumphdinfo(), dumpprivkey(), dumpwallet(), encryptwallet(), estimatefee(), estimatepriority(), estimatesmartfee(), estimatesmartpriority(), fundrawtransaction(), generate(), getaccount(), getaccountaddress(), getaddednodeinfo(), getaddressbalance(), getaddressdeltas(), getaddressesbyaccount(), getaddressmempool(), getaddresstxids(), getaddressutxos(), getbalance(), getbestblockhash(), getblock(), getblockchaininfo(), getblockcount(), getblockhash(), getblockhashes(), getblockheader(), getblockheaders(), getblocktemplate(), getchaintips(), getconnectioncount(), getdifficulty(), CKeePassIntegrator::CKeePassResponse::getEntries(), getgenerate(), getgovernanceinfo(), getinfo(), getmempoolinfo(), getmininginfo(), getnettotals(), getnetworkhashps(), getnetworkinfo(), getnewaddress(), getpeerinfo(), getpoolinfo(), getrawchangeaddress(), getrawmempool(), getrawtransaction(), getreceivedbyaccount(), getreceivedbyaddress(), getspentinfo(), getsuperblockbudget(), gettransaction(), gettxout(), gettxoutproof(), gettxoutsetinfo(), getunconfirmedbalance(), getwalletinfo(), gobject(), help(), importaddress(), importelectrumwallet(), importprivkey(), importpubkey(), importwallet(), instantsendtoaddress(), invalidateblock(), JSONRPCExecBatch(), keepass(), keypoolrefill(), listaccounts(), listbanned(), listlockunspent(), ListReceived(), listreceivedbyaccount(), listreceivedbyaddress(), listsinceblock(), listtransactions(), listunspent(), lockunspent(), masternode(), masternodebroadcast(), masternodelist(), mnsync(), movecmd(), MutateTxSign(), ParseNonRFCJSONValue(), ping(), prioritisetransaction(), privatesend(), reconsiderblock(), resendwallettransactions(), RPCTypeCheck(), sendfrom(), sendmany(), sendrawtransaction(), sendtoaddress(), sentinelping(), setaccount(), setban(), setgenerate(), setmocktime(), setnetworkactive(), settxfee(), signmessage(), signrawtransaction(), spork(), stop(), submitblock(), validateaddress(), verifychain(), verifymessage(), verifytxoutproof(), voteraw(), walletlock(), walletpassphrase(), and walletpassphrasechange().

◆ type()

enum VType UniValue::type ( ) const
inline

Definition at line 155 of file univalue.h.

Referenced by RPCTypeCheck(), RPCTypeCheckObj(), and ScriptPubKeyToUniv().

◆ write()

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

Definition at line 70 of file univalue_write.cpp.

◆ writeObject()

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

Definition at line 94 of file univalue_write.cpp.

Friends And Related Function Documentation

◆ find_value

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

Definition at line 280 of file univalue.cpp.

Member Data Documentation

◆ keys

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

Definition at line 135 of file univalue.h.

Referenced by find_value(), pushKVs(), and read().

◆ typ

UniValue::VType UniValue::typ
private

◆ val

std::string UniValue::val
private

Definition at line 134 of file univalue.h.

Referenced by getValStr(), isFalse(), isTrue(), pushKV(), setInt(), and UniValue().

◆ values

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

Definition at line 136 of file univalue.h.

Referenced by empty(), find_value(), pushKVs(), read(), and size().


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