Changeset View
Changeset View
Standalone View
Standalone View
src/univalue/include/univalue.h
// Copyright 2014 BitPay Inc. | // Copyright 2014 BitPay Inc. | ||||
// Copyright 2015 Bitcoin Core Developers | // Copyright 2015 Bitcoin Core Developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or https://opensource.org/licenses/mit-license.php. | ||||
#ifndef __UNIVALUE_H__ | #ifndef __UNIVALUE_H__ | ||||
#define __UNIVALUE_H__ | #define __UNIVALUE_H__ | ||||
#include <stdint.h> | #include <stdint.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <string> | #include <string> | ||||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | public: | ||||
bool pushKV(const std::string& key, int64_t val_) { | bool pushKV(const std::string& key, int64_t val_) { | ||||
UniValue tmpVal(val_); | UniValue tmpVal(val_); | ||||
return pushKV(key, tmpVal); | return pushKV(key, tmpVal); | ||||
} | } | ||||
bool pushKV(const std::string& key, uint64_t val_) { | bool pushKV(const std::string& key, uint64_t val_) { | ||||
UniValue tmpVal(val_); | UniValue tmpVal(val_); | ||||
return pushKV(key, tmpVal); | return pushKV(key, tmpVal); | ||||
} | } | ||||
bool pushKV(const std::string& key, bool val_) { | |||||
UniValue tmpVal((bool)val_); | |||||
return pushKV(key, tmpVal); | |||||
} | |||||
bool pushKV(const std::string& key, int val_) { | bool pushKV(const std::string& key, int val_) { | ||||
UniValue tmpVal((int64_t)val_); | UniValue tmpVal((int64_t)val_); | ||||
return pushKV(key, tmpVal); | return pushKV(key, tmpVal); | ||||
} | } | ||||
bool pushKV(const std::string& key, double val_) { | bool pushKV(const std::string& key, double val_) { | ||||
UniValue tmpVal(val_); | UniValue tmpVal(val_); | ||||
return pushKV(key, tmpVal); | return pushKV(key, tmpVal); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines |