title: How to list files in a directory on cocos2d-x?
body: <p>I saved files on the writable directory of iPhone simulator.
  The files can be removed and created dynamically in run time.
  I want to list these files in the specific directory by using directory path, not filename.</p>
  
  <p>Example:</p>
  
  <pre><code>/Users/mine/Library/Application Support/iPhone Simulator/7.1/Applications/022F7891-1983-4791-AB59-451B2EAF4FB8/Documents/stage/stage_1.json
  /Users/mine/Library/Application Support/iPhone Simulator/7.1/Applications/022F7891-1983-4791-AB59-451B2EAF4FB8/Documents/stage/stage_2.json
  /Users/mine/Library/Application Support/iPhone Simulator/7.1/Applications/022F7891-1983-4791-AB59-451B2EAF4FB8/Documents/stage/stage_24.json
  /Users/mine/Library/Application Support/iPhone Simulator/7.1/Applications/022F7891-1983-4791-AB59-451B2EAF4FB8/Documents/stage/stage_3.json
  /Users/mine/Library/Application Support/iPhone Simulator/7.1/Applications/022F7891-1983-4791-AB59-451B2EAF4FB8/Documents/stage/stage_4.bmp
  </code></pre>
  
  <blockquote>
    <p>vector = getFilesInDir(FileUtils::getInstance()->getWritablePath()+string("Documents/stage"), "json");</p>
    
    <p>vector => ("stage_1.json", "stage_1.json", "stage_1.json", "stage_1.json")</p>
  </blockquote>