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 @@ -58,21 +58,11 @@ class UniValue {
5858 UniValue (const std::string& val_) : typ(VSTR), val(val_) {}
5959 UniValue (std::string&& val_) : typ(VSTR), val(std::move(val_)) {}
6060 UniValue (const char *val_) : typ(VSTR), val(val_) {}
61- UniValue (uint64_t val_) {
62- setInt (val_);
63- }
64- UniValue (int64_t val_) {
65- setInt (val_);
66- }
67- UniValue (bool val_) {
68- setBool (val_);
69- }
70- UniValue (int val_) {
71- setInt (val_);
72- }
73- UniValue (double val_) {
74- setFloat (val_);
75- }
61+ UniValue (uint64_t val_);
62+ UniValue (int64_t val_);
63+ UniValue (bool val_);
64+ UniValue (int val_);
65+ UniValue (double val_);
7666
7767 void clear ();
7868
Original file line number Diff line number Diff line change @@ -39,6 +39,32 @@ void appendNumToString(T n, std::string& str)
3939
4040}
4141
42+ UniValue::UniValue (uint64_t val_) : typ(VNUM)
43+ {
44+ appendNumToString (val_, val);
45+ }
46+
47+ UniValue::UniValue (int64_t val_) : typ(VNUM)
48+ {
49+ appendNumToString (val_, val);
50+ }
51+
52+ UniValue::UniValue (bool val_) : typ(VBOOL)
53+ {
54+ if (val_)
55+ val = " 1" ;
56+ }
57+
58+ UniValue::UniValue (int val_) : typ(VNUM)
59+ {
60+ appendNumToString (val_, val);
61+ }
62+
63+ UniValue::UniValue (double val_) : typ(VNUM)
64+ {
65+ setFloat (val_);
66+ }
67+
4268void UniValue::clear ()
4369{
4470 typ = VNULL;
You can’t perform that action at this time.
0 commit comments