Revisions
-
kw0006667 revised this gist
Mar 20, 2013 . 2 changed files with 43 additions and 16 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,23 +1,22 @@ #ifndef __CXMLSTREAM_H__ #define __CXMLSTREAM_H__ #include "cocos2d.h" USING_NS_CC; class CXmlStream { private: CCDictionary* m_dictionary; public: CXmlStream(const char* dicFilename); ~CXmlStream(); const char* GetStringByKey(const char* keyword); static const char* GetStringByKeyFromFile(const char* dicFilename, const char* keyword); }; #endif This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ <dict> <key>HomeScene</key> <string>首頁</string> <key>MainScene</key> <string>主頁</string> <key>BookScene</key> <string>百科</string> <key>GameScene</key> <string>遊戲</string> <key>AnimScene</key> <string>動畫</string> <key>FOgameScene</key> <string>力的作用</string> <key>FOgameScene_Book</key> <string>力的作用 - 百科</string> <key>FOgameScene_Game</key> <string>力的作用 - 遊戲</string> <key>FOgameScene_Anim</key> <string>力的作用 - 動畫</string> <key>GVScene</key> <string>地球引力</string> <key>GVScene_Book</key> <string>地球引力 - 百科</string> <key>GVScene_Game</key> <string>地球引力 - 遊戲</string> <key>GVScene_Anim</key> <string>地球引力 - 動畫</string> </dict> -
kw0006667 revised this gist
Mar 20, 2013 . 1 changed file with 23 additions and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #include "CXmlStream.h" CXmlStream::CXmlStream(const char* dicFilename) { this->m_dictionary = CCDictionary::createWithContentsOfFile(dicFilename); } CXmlStream::~CXmlStream() { } const char* CXmlStream::GetStringByKey(const char* keyword) { return ((CCString*)(this->m_dictionary->objectForKey(keyword)))->m_sString.c_str(); } const char* CXmlStream::GetStringByKeyFromFile(const char* dicFilename, const char* keyword) { CCDictionary *dictionary = CCDictionary::createWithContentsOfFile(dicFilename); return ((CCString*)dictionary->objectForKey(keyword))->m_sString.c_str(); } -
kw0006667 created this gist
Mar 20, 2013 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #include "CXmlStream.h" CXmlStream::CXmlStream(const char* dicFilename) { this->m_dictionary = CCDictionary::createWithContentsOfFile(dicFilename); } CXmlStream::~CXmlStream() { } const char* CXmlStream::GetStringByKey(const char* keyword) { return ((CCString*)(this->m_dictionary->objectForKey(keyword)))->m_sString.c_str(); } const char* CXmlStream::GetStringByKeyFromFile(const char* dicFilename, const char* keyword) { CCDictionary *dictionary = CCDictionary::createWithContentsOfFile(dicFilename); return ((CCString*)dictionary->objectForKey(keyword))->m_sString.c_str(); }