This repository was archived by the owner on Jun 17, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +31
-15
lines changed Expand file tree Collapse file tree 2 files changed +31
-15
lines changed Original file line number Diff line number Diff line change @@ -59,21 +59,11 @@ class UniValue {
5959 UniValue (const std::string& val_) : typ(VSTR), val(val_) {}
6060 UniValue (std::string&& val_) : typ(VSTR), val(std::move(val_)) {}
6161 UniValue (const char *val_) : typ(VSTR), val(val_) {}
62- UniValue (uint64_t val_) {
63- setInt (val_);
64- }
65- UniValue (int64_t val_) {
66- setInt (val_);
67- }
68- UniValue (bool val_) {
69- setBool (val_);
70- }
71- UniValue (int val_) {
72- setInt (val_);
73- }
74- UniValue (double val_) {
75- setFloat (val_);
76- }
62+ UniValue (uint64_t val_);
63+ UniValue (int64_t val_);
64+ UniValue (bool val_);
65+ UniValue (int val_);
66+ UniValue (double val_);
7767
7868 void clear ();
7969
Original file line number Diff line number Diff line change @@ -42,6 +42,32 @@ void appendNumToString(T n, std::string& str)
4242
4343}
4444
45+ UniValue::UniValue (uint64_t val_) : typ(VNUM)
46+ {
47+ appendNumToString (val_, val);
48+ }
49+
50+ UniValue::UniValue (int64_t val_) : typ(VNUM)
51+ {
52+ appendNumToString (val_, val);
53+ }
54+
55+ UniValue::UniValue (bool val_) : typ(VBOOL)
56+ {
57+ if (val_)
58+ val = " 1" ;
59+ }
60+
61+ UniValue::UniValue (int val_) : typ(VNUM)
62+ {
63+ appendNumToString (val_, val);
64+ }
65+
66+ UniValue::UniValue (double val_) : typ(VNUM)
67+ {
68+ setFloat (val_);
69+ }
70+
4571void UniValue::clear ()
4672{
4773 typ = VNULL;
You can’t perform that action at this time.
0 commit comments