Search code examples
xmljsoncocos2d-x

Converting XML file of CCUserDefault to JSON string


How can I convert XML data, generated by CCUserDefault in cocos2dx, to JSON string.

Thanks


Solution

  • I figured out how to access XML content.

    Simply use the following line

    xmlData = CCFileUtils::sharedFileUtils()->getFileData(CCUserDefault::sharedUserDefault()->getXMLFilePath().c_str(), "r", &tmpSize);