#pragma once

#include <string>
#include "cocos2d.h"
#include "cocos-ext.h"

namespace json
{
    using std::string;

    using namespace rapidjson; // library that we use for json parsing
    
    class CManager
    {
    public:
        
        static CManager* getInstance();
        
        /**
         @brief open json file
         @param full file name with path
         */
        bool openFile(const string& kstrFileFullName);
        
        /**
         @brief get string from a document
         @param key
         */
        string getStringForKey(const string& kstrKey);
        
        /**
        @brief get int from a document
        @param key
        */
        int getIntForKey(const string& kstrKey);

		Document* getOpenedDocument();
        
    private:
        
        CManager();
        ~CManager();
        
    private:
        static CManager* m_instance;
        Document m_pcDocument; // current document with language data
		std::string m_CurrentOpenedFile;
    };
}
