Debugger: Split into core library and application.
[haiku.git] / headers / private / shared / Json.h
blob6df2648e63f3ba5244d1829cc6633c342fdda2f4
1 /*
2 * Copyright 2014, Augustin Cavalier (waddlesplash)
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef JSON_H
6 #define JSON_H
8 #include <Message.h>
9 #include <String.h>
11 namespace BPrivate {
13 class BJson {
14 public:
15 enum JsonObjectType {
16 JSON_TYPE_MAP = '_JTM',
17 JSON_TYPE_ARRAY = '_JTA'
20 public:
21 static status_t Parse(BMessage& message, const char* JSON);
22 static status_t Parse(BMessage& message, BString& JSON);
24 private:
25 static void _Parse(BMessage& message, BString& JSON);
26 static BString _ParseString(BString& JSON, int32& pos);
27 static double _ParseNumber(BString& JSON, int32& pos);
28 static bool _ParseConstant(BString& JSON, int32& pos,
29 const char* constant);
32 } // namespace BPrivate
34 using BPrivate::BJson;
36 #endif // JSON_H