Skip to content

Commit 4436cec

Browse files
committed
Add unsigned long constructor and operator=
1 parent 20c0679 commit 4436cec

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/JSONVar.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ JSONVar::JSONVar(long l) :
4545
*this = l;
4646
}
4747

48+
JSONVar::JSONVar(unsigned long ul) :
49+
JSONVar()
50+
{
51+
*this = ul;
52+
}
53+
4854
JSONVar::JSONVar(double d) :
4955
JSONVar()
5056
{
@@ -200,6 +206,11 @@ void JSONVar::operator=(long l)
200206
replaceJson(cJSON_CreateNumber(l));
201207
}
202208

209+
void JSONVar::operator=(unsigned long ul)
210+
{
211+
replaceJson(cJSON_CreateNumber(ul));
212+
}
213+
203214
void JSONVar::operator=(double d)
204215
{
205216
replaceJson(cJSON_CreateNumber(d));

src/JSONVar.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class JSONVar : public Printable {
3333
JSONVar(bool b);
3434
JSONVar(int i);
3535
JSONVar(long l);
36+
JSONVar(unsigned long ul);
3637
JSONVar(double d);
3738
JSONVar(const char* s);
3839
JSONVar(const String& s);
@@ -58,6 +59,7 @@ class JSONVar : public Printable {
5859
void operator=(bool b);
5960
void operator=(int i);
6061
void operator=(long l);
62+
void operator=(unsigned long ul);
6163
void operator=(double d);
6264
void operator=(const char* s);
6365
void operator=(const String& s);

0 commit comments

Comments
 (0)