Browse Source

[fix][wip] Refs #1 Array of non-primitive (scroll issue)

isundil 9 years ago
parent
commit
88cb50ff5e
2 changed files with 5 additions and 0 deletions
  1. 4 0
      src/streamConsumer.cpp
  2. 1 0
      test/test.json

+ 4 - 0
src/streamConsumer.cpp

@@ -83,6 +83,10 @@ JSonArray *StreamConsumer::readArray(JSonContainer *parent)
         return new JSonArray(parent); //Empty object
         return new JSonArray(parent); //Empty object
     do
     do
     {
     {
+        if (child == nullptr && buf == "[")
+            child = readArray(nullptr);
+        if (child == nullptr && buf == "{")
+            child = readObject(nullptr);
         if (child == nullptr)
         if (child == nullptr)
             throw JsonException(stream.tellg());
             throw JsonException(stream.tellg());
         if (result == nullptr)
         if (result == nullptr)

+ 1 - 0
test/test.json

@@ -1,4 +1,5 @@
 {"sampleArray":[
 {"sampleArray":[
+    [true, [true], true],
     {
     {
         "0":"897316929176464ebc9ad085f31e7284",
         "0":"897316929176464ebc9ad085f31e7284",
         "1":"b026324c6904b2a9cb4b88d6d61c81d1",
         "1":"b026324c6904b2a9cb4b88d6d61c81d1",