toJSON(): Support some more types

This commit is contained in:
Eelco Dolstra
2016-10-06 17:00:52 +02:00
parent ae522f930d
commit b0f7f9c98f
2 changed files with 12 additions and 0 deletions
+10
View File
@@ -44,6 +44,16 @@ void toJSON(std::ostream & str, long n)
str << n;
}
void toJSON(std::ostream & str, unsigned int n)
{
str << n;
}
void toJSON(std::ostream & str, int n)
{
str << n;
}
void toJSON(std::ostream & str, double f)
{
str << f;
+2
View File
@@ -12,6 +12,8 @@ void toJSON(std::ostream & str, const char * s);
void toJSON(std::ostream & str, unsigned long long n);
void toJSON(std::ostream & str, unsigned long n);
void toJSON(std::ostream & str, long n);
void toJSON(std::ostream & str, unsigned int n);
void toJSON(std::ostream & str, int n);
void toJSON(std::ostream & str, double f);
void toJSON(std::ostream & str, bool b);