toJSON(): Support some more types

This commit is contained in:
Eelco Dolstra 2016-10-06 16:34:28 +02:00
parent ae522f930d
commit b0f7f9c98f
2 changed files with 12 additions and 0 deletions

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;

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);