2 * Copyright 2017, Andrew Lindesay <apl@lindesay.co.nz>
3 * Distributed under the terms of the MIT License.
5 #ifndef _JSON_MESSAGE_WRITER_H
6 #define _JSON_MESSAGE_WRITER_H
9 #include "JsonWriter.h"
15 enum json_message_container_what
{
16 B_JSON_MESSAGE_WHAT_OBJECT
= '_JTM',
17 B_JSON_MESSAGE_WHAT_ARRAY
= '_JTA'
23 class BStackedMessageEventListener
;
25 class BJsonMessageWriter
: public BJsonWriter
{
26 friend class BStackedMessageEventListener
;
28 BJsonMessageWriter(BMessage
& message
);
29 virtual ~BJsonMessageWriter();
31 bool Handle(const BJsonEvent
& event
);
35 void SetStackedListener(
36 BStackedMessageEventListener
* listener
);
38 BMessage
* fTopLevelMessage
;
39 BStackedMessageEventListener
*
44 } // namespace BPrivate
46 using BPrivate::BJsonMessageWriter
;
48 #endif // _JSON_MESSAGE_WRITER_H