title: get array data from json file using rapidjson
body: <p>I'm new in rapidjson. I have <code>test.json</code> which contains <code>{"points": [1,2,3,4]}</code></p>
  
  <p>and I use following code to get data of array <code>"points"</code>    </p>
  
  <pre><code>std::string fullPath = CCFileUtils::sharedFileUtils()-&gt;fullPathForFilename("json/deluxe/treasurebag.json");
  
      unsigned long bufferSize = 0;
  
      const char* mFileData = (const char*)CCFileUtils::sharedFileUtils()-&gt;getFileData(fullPath.c_str(), "r", &amp;bufferSize);
  
      std::string clearData(mFileData);
      size_t pos = clearData.rfind("}");
      clearData = clearData.substr(0, pos+1);
      document.Parse&lt;0&gt;(clearData.c_str());
      assert(document.HasMember("points"));
  
      const Value&amp; a = document["points"]; // Using a reference for consecutive access is handy and faster.
      assert(a.IsArray());
      for (SizeType i = 0; i &lt; a.Size(); i++) // rapidjson uses SizeType instead of size_t.
          CCLOG("a[%d] = %d\n", i, a[i].GetInt());
  </code></pre>
  
  <p>and its result is </p>
  
  <pre><code>Cocos2d: a[0] = 1
  Cocos2d: a[1] = 2
  Cocos2d: a[2] = 3
  Cocos2d: a[3] = 4
  </code></pre>
  
  <p>as expected. But now when I try to get data (get <code>x</code> and <code>y</code>) from an array like this</p>
  
  <p><code>{"points": [{"y": -14.25,"x": -2.25},{"y": -13.25,"x": -5.75},{"y": -12.5,"x": -7.25}]}</code></p>
  
  <p>an error occured and threw away in compiler:</p>
  
  <pre><code>//! Get the number of elements in array.
      SizeType Size() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size; }
  </code></pre>
  
  <p>Can anyone explain what i did wrong or something's missed? Sorry for my bad English.</p>
  
  <p>Any helps would be appreciated.</p>
  
  <p>Thanks.</p>