Make UEFI boot-platform build again
[haiku.git] / headers / private / shared / JsonTextWriter.h
bloba4e57f3d66ed91c1002521bb6b4d487a68002017
1 /*
2 * Copyright 2017, Andrew Lindesay <apl@lindesay.co.nz>
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _JSON_STRING_STREAM_WRITER_H
6 #define _JSON_STRING_STREAM_WRITER_H
9 #include "JsonWriter.h"
11 #include <DataIO.h>
12 #include <String.h>
15 namespace BPrivate {
17 class BJsonTextWriterStackedEventListener;
19 class BJsonTextWriter : public BJsonWriter {
20 friend class BJsonTextWriterStackedEventListener;
21 public:
22 BJsonTextWriter(BDataIO* dataIO);
23 virtual ~BJsonTextWriter();
25 bool Handle(const BJsonEvent& event);
26 void Complete();
28 private:
29 void SetStackedListener(
30 BJsonTextWriterStackedEventListener*
31 stackedListener);
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);
49 BDataIO* fDataIO;
50 BJsonTextWriterStackedEventListener*
51 fStackedListener;
53 char fUnicodeAssemblyBuffer[7];
57 } // namespace BPrivate
59 using BPrivate::BJsonTextWriter;
61 #endif // _JSON_STRING_STREAM_WRITER_H