2 * Copyright 2017, Andrew Lindesay <apl@lindesay.co.nz>
3 * Distributed under the terms of the MIT License.
5 #ifndef _JSON_STRING_STREAM_WRITER_H
6 #define _JSON_STRING_STREAM_WRITER_H
9 #include "JsonWriter.h"
17 class BJsonTextWriterStackedEventListener
;
19 class BJsonTextWriter
: public BJsonWriter
{
20 friend class BJsonTextWriterStackedEventListener
;
22 BJsonTextWriter(BDataIO
* dataIO
);
23 virtual ~BJsonTextWriter();
25 bool Handle(const BJsonEvent
& event
);
29 void SetStackedListener(
30 BJsonTextWriterStackedEventListener
*
33 status_t
StreamNumberNode(const BJsonEvent
& event
);
35 status_t
StreamStringVerbatim(const char* string
);
36 status_t
StreamStringVerbatim(const char* string
,
37 off_t offset
, size_t length
);
39 status_t
StreamStringEncoded(const char* string
);
40 status_t
StreamStringEncoded(const char* string
,
41 off_t offset
, size_t length
);
43 status_t
StreamQuotedEncodedString(const char* string
);
44 status_t
StreamQuotedEncodedString(const char* string
,
45 off_t offset
, size_t length
);
47 status_t
StreamChar(char c
);
50 BJsonTextWriterStackedEventListener
*
53 char fUnicodeAssemblyBuffer
[7];
57 } // namespace BPrivate
59 using BPrivate::BJsonTextWriter
;
61 #endif // _JSON_STRING_STREAM_WRITER_H