This class provides an interface to writing json values directly to a stream.
More...
|
JS_API | JsWriter (std::ostream &ostr, Style style=Style::Compact) |
| Constructor. More...
|
|
JS_API | ~JsWriter () |
| Destructor. More...
|
|
| JsWriter (const JsWriter &)=delete |
| Disable copies. More...
|
|
JsWriter & | operator= (const JsWriter &)=delete |
|
JS_API bool | WriteValue (std::nullptr_t) |
| Write a null value. More...
|
|
JS_API bool | WriteValue (bool b) |
| Write a boolean value. More...
|
|
JS_API bool | WriteValue (int i) |
| Write an integer value. More...
|
|
JS_API bool | WriteValue (unsigned u) |
| Write an unsigned integer value. More...
|
|
JS_API bool | WriteValue (int64_t i) |
| Write a 64-bit integer value. More...
|
|
JS_API bool | WriteValue (uint64_t u) |
| Write a 64-bit unsigned integer value. More...
|
|
JS_API bool | WriteValue (double d) |
| Write a double value. More...
|
|
JS_API bool | WriteValue (const std::string &s) |
| Write a string value. More...
|
|
JS_API bool | WriteValue (const char *s) |
| Write a string value. More...
|
|
template<size_t N> |
bool | WriteValue (const char(&s)[N]) |
| Write a string value. More...
|
|
JS_API bool | BeginObject () |
| Write the start of an object. More...
|
|
JS_API bool | WriteKey (const std::string &) |
| Write an object key. More...
|
|
JS_API bool | WriteKey (const char *) |
| Write an object key. More...
|
|
template<size_t N> |
bool | WriteKey (const char(&s)[N]) |
| Write a string literal object key. More...
|
|
template<class K , class V > |
void | WriteKeyValue (K &&k, V &&v) |
| Convenience function to write an object key and value. More...
|
|
JS_API bool | EndObject () |
| Write the end of an object. More...
|
|
JS_API bool | BeginArray () |
| Write the start of an array. More...
|
|
JS_API bool | EndArray () |
| Write the end of an array. More...
|
|
template<class Container > |
void | WriteArray (const Container &c) |
| Convenience function to write an array of values. More...
|
|
template<class Container , class ItemWriteFn > |
void | WriteArray (const Container &c, const ItemWriteFn &f) |
| Convenience function to write an array of values by calling the given functor for each item in the container. More...
|
|
template<class Iterator , class ItemWriteFn > |
void | WriteArray (const Iterator &begin, const Iterator &end, const ItemWriteFn &f) |
| Convenience function to write an array of values given two iterators by calling the given functor for each item in the container. More...
|
|
template<class ... T> |
void | WriteObject (T &&... f) |
| Convenience function to write an object given key value pair arguments. More...
|
|
This class provides an interface to writing json values directly to a stream.
This can be much more efficient than constructing a JsValue instance and using JsWriteToStream if the data size is significant.
Definition at line 76 of file json.h.