Skip to content
Snippets Groups Projects
Commit 7a173a7b authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

JSONObject: Support floats and booleans

parent 7251a81b
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,18 @@ struct JSONObject ...@@ -36,7 +36,18 @@ struct JSONObject
attr(s); attr(s);
escapeJSON(str, t); escapeJSON(str, t);
} }
void attr(const string & s, int n) void attr(const string & s, const char * t)
{
attr(s);
escapeJSON(str, t);
}
void attr(const string & s, bool b)
{
attr(s);
str << (b ? "true" : "false");
}
template<typename T>
void attr(const string & s, const T & n)
{ {
attr(s); attr(s);
str << n; str << n;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment