mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Squashed 'src/univalue/' changes from 51d3ab34ba..7890db99d6
7890db99d6 Merge #11: Remove deprecated std pair wrappers 40e34852ac Merge #14: Cleaned up namespace imports to reduce symbol collisions 85052a4819 Remove deprecated std::pair wrappers d208f986dd Cleaned up namespace imports to reduce symbol collisions git-subtree-dir: src/univalue git-subtree-split: 7890db99d693572d27ade3e14268bd7236134529
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
#include <cassert>
|
||||
|
||||
#include <sstream> // .get_int64()
|
||||
#include <utility> // std::pair
|
||||
|
||||
class UniValue {
|
||||
public:
|
||||
@@ -177,76 +176,9 @@ public:
|
||||
const UniValue& get_array() const;
|
||||
|
||||
enum VType type() const { return getType(); }
|
||||
bool push_back(std::pair<std::string,UniValue> pear) {
|
||||
return pushKV(pear.first, pear.second);
|
||||
}
|
||||
friend const UniValue& find_value( const UniValue& obj, const std::string& name);
|
||||
};
|
||||
|
||||
//
|
||||
// The following were added for compatibility with json_spirit.
|
||||
// Most duplicate other methods, and should be removed.
|
||||
//
|
||||
static inline std::pair<std::string,UniValue> Pair(const char *cKey, const char *cVal)
|
||||
{
|
||||
std::string key(cKey);
|
||||
UniValue uVal(cVal);
|
||||
return std::make_pair(key, uVal);
|
||||
}
|
||||
|
||||
static inline std::pair<std::string,UniValue> Pair(const char *cKey, std::string strVal)
|
||||
{
|
||||
std::string key(cKey);
|
||||
UniValue uVal(strVal);
|
||||
return std::make_pair(key, uVal);
|
||||
}
|
||||
|
||||
static inline std::pair<std::string,UniValue> Pair(const char *cKey, uint64_t u64Val)
|
||||
{
|
||||
std::string key(cKey);
|
||||
UniValue uVal(u64Val);
|
||||
return std::make_pair(key, uVal);
|
||||
}
|
||||
|
||||
static inline std::pair<std::string,UniValue> Pair(const char *cKey, int64_t i64Val)
|
||||
{
|
||||
std::string key(cKey);
|
||||
UniValue uVal(i64Val);
|
||||
return std::make_pair(key, uVal);
|
||||
}
|
||||
|
||||
static inline std::pair<std::string,UniValue> Pair(const char *cKey, bool iVal)
|
||||
{
|
||||
std::string key(cKey);
|
||||
UniValue uVal(iVal);
|
||||
return std::make_pair(key, uVal);
|
||||
}
|
||||
|
||||
static inline std::pair<std::string,UniValue> Pair(const char *cKey, int iVal)
|
||||
{
|
||||
std::string key(cKey);
|
||||
UniValue uVal(iVal);
|
||||
return std::make_pair(key, uVal);
|
||||
}
|
||||
|
||||
static inline std::pair<std::string,UniValue> Pair(const char *cKey, double dVal)
|
||||
{
|
||||
std::string key(cKey);
|
||||
UniValue uVal(dVal);
|
||||
return std::make_pair(key, uVal);
|
||||
}
|
||||
|
||||
static inline std::pair<std::string,UniValue> Pair(const char *cKey, const UniValue& uVal)
|
||||
{
|
||||
std::string key(cKey);
|
||||
return std::make_pair(key, uVal);
|
||||
}
|
||||
|
||||
static inline std::pair<std::string,UniValue> Pair(std::string key, const UniValue& uVal)
|
||||
{
|
||||
return std::make_pair(key, uVal);
|
||||
}
|
||||
|
||||
enum jtokentype {
|
||||
JTOK_ERR = -1,
|
||||
JTOK_NONE = 0, // eof
|
||||
|
||||
Reference in New Issue
Block a user