We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 10a3ecd commit 4f7e758Copy full SHA for 4f7e758
ext/rapidjson/parser.hh
@@ -7,6 +7,19 @@
7
using namespace rapidjson;
8
9
class NullHandler : public BaseReaderHandler<UTF8<>, NullHandler> {
10
+ static const int MAX_DEPTH = 256;
11
+ int depth = 0;
12
+ bool push() {
13
+ return depth++ < MAX_DEPTH;
14
+ }
15
+ bool pop() {
16
+ return depth-- > 0;
17
18
+ public:
19
+ bool StartObject() { return push(); }
20
+ bool EndObject(SizeType s) { return pop(); }
21
+ bool StartArray() { return push(); }
22
+ bool EndArray(SizeType s) { return pop(); }
23
};
24
25
struct RubyObjectHandler : public BaseReaderHandler<UTF8<>, RubyObjectHandler> {
0 commit comments