diff --git a/src/libexpr/value-to-json.hh b/src/libexpr/value-to-json.hh index f6796f205..c59caf564 100644 --- a/src/libexpr/value-to-json.hh +++ b/src/libexpr/value-to-json.hh @@ -36,7 +36,18 @@ struct JSONObject attr(s); 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 + void attr(const string & s, const T & n) { attr(s); str << n;