* revert CCFileUtils_ios.mm to 0.9.2

This commit is contained in:
YuLei Liao 2011-11-23 13:48:15 +08:00
parent 4ff2bf96d1
commit a8240abbe2
1 changed files with 2 additions and 12 deletions

View File

@ -291,16 +291,7 @@ namespace cocos2d {
pRet->m_sString += pszFilename;
return pRet->m_sString.c_str();
}
CCDictionary<std::string, CCObject*> *CCFileUtils::dictionaryWithContentsOfFile(const char *pFileName)
{
CCDictionary<std::string, CCObject*> *ret = dictionaryWithContentsOfFileThreadSafe(pFileName);
ret->autorelease();
return ret;
}
CCDictionary<std::string, CCObject*> *CCFileUtils::dictionaryWithContentsOfFileThreadSafe(const char *pFileName)
{
NSString* pPath = [NSString stringWithUTF8String:pFileName];
NSDictionary* pDict = [NSDictionary dictionaryWithContentsOfFile:pPath];
@ -310,10 +301,9 @@ namespace cocos2d {
id value = [pDict objectForKey:key];
static_addValueToCCDict(key, value, pRet);
}
pRet->autorelease();
return pRet;
}
unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize)
{
unsigned char * pBuffer = NULL;
@ -331,7 +321,7 @@ namespace cocos2d {
*pSize = fread(pBuffer,sizeof(unsigned char), *pSize,fp);
fclose(fp);
} while (0);
if (! pBuffer)
{
CCLOG("Get data from file(%s) failed!", pszFileName);