Comments some logs in CCFileUtils.

This commit is contained in:
James Chen 2013-01-29 19:12:55 +08:00
parent 5e7ca24335
commit bb431c54ed
6 changed files with 24 additions and 25 deletions

View File

@ -382,7 +382,7 @@ std::string CCFileUtils::getNewFilename(const char* pszFileName)
}
else {
pszNewFileName = fileNameFound->getCString();
CCLOG("FOUND NEW FILE NAME: %s.", pszNewFileName);
//CCLOG("FOUND NEW FILE NAME: %s.", pszNewFileName);
}
return pszNewFileName;
}
@ -442,7 +442,6 @@ void CCFileUtils::loadFilenameLookupDictionaryFromFile(const char* filename)
CCLOG("cocos2d: ERROR: Invalid filenameLookup dictionary version: %ld. Filename: %s", (long)version, filename);
return;
}
CCLOG("Found file lookup plist.");
setFilenameLookupDictionary((CCDictionary*)pDict->objectForKey("filenames"));
}
}

View File

@ -94,14 +94,14 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
std::string strFileName = pszFileName;
if (pszFileName[0] == '/' || strFileName.find(m_strDefaultResRootPath) == 0)
{
CCLOG("Return absolute path( %s ) directly.", pszFileName);
//CCLOG("Return absolute path( %s ) directly.", pszFileName);
return pszFileName;
}
// Already Cached ?
std::map<std::string, std::string>::iterator cacheIter = s_fullPathCache.find(pszFileName);
if (cacheIter != s_fullPathCache.end())
{
CCLOG("Return full path from cache: %s", cacheIter->second.c_str());
//CCLOG("Return full path from cache: %s", cacheIter->second.c_str());
return cacheIter->second;
}
@ -117,8 +117,8 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
for (std::vector<std::string>::iterator resOrderIter = m_searchResolutionsOrderArray.begin();
resOrderIter != m_searchResolutionsOrderArray.end(); ++resOrderIter) {
CCLOG("\n\nSEARCHING: %s, %s, %s", newFilename.c_str(), resOrderIter->c_str(), searchPathsIter->c_str());
fullpath = this->getPathForFilename(newFilename, *resOrderIter, *searchPathsIter);
//CCLOG("\n\nSEARCHING: %s, %s, %s", newFilename.c_str(), resOrderIter->c_str(), searchPathsIter->c_str());
fullpath = this->getPathForFilename(newFilename, *resOrderIter, *searchPathsIter);
// Check whether file exists in apk.
if (s_pZipFile->fileExists(fullpath))
@ -138,7 +138,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
{
// Using the filename passed in as key.
s_fullPathCache.insert(std::pair<std::string, std::string>(pszFileName, fullpath));
CCLOG("Returning path: %s", fullpath.c_str());
//CCLOG("Returning path: %s", fullpath.c_str());
return fullpath;
}
}
@ -183,7 +183,7 @@ std::string CCFileUtils::getPathForFilename(const std::string& filename, const s
}
path += file;
CCLOG("getPathForFilename, fullPath = %s", path.c_str());
//CCLOG("getPathForFilename, fullPath = %s", path.c_str());
return path;
}
@ -198,7 +198,7 @@ unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* psz
if (pszFileName[0] != '/')
{
CCLOG("GETTING FILE RELATIVE DATA: %s", pszFileName);
//CCLOG("GETTING FILE RELATIVE DATA: %s", pszFileName);
string fullPath = fullPathForFilename(pszFileName);
pData = s_pZipFile->getFileData(fullPath.c_str(), pSize);
}
@ -207,7 +207,7 @@ unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* psz
do
{
// read rrom other path than user set it
CCLOG("GETTING FILE ABSOLUTE DATA: %s", pszFileName);
//CCLOG("GETTING FILE ABSOLUTE DATA: %s", pszFileName);
FILE *fp = fopen(pszFileName, pszMode);
CC_BREAK_IF(!fp);
@ -276,7 +276,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
if (!bExistDefaultRootPath)
{
CCLOG("Default root path doesn't exist, adding it.");
//CCLOG("Default root path doesn't exist, adding it.");
m_searchPathArray.push_back(m_strDefaultResRootPath);
}
}

View File

@ -107,14 +107,14 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
std::string strFileName = pszFileName;
if (pszFileName[0] == '/' || strFileName.find(m_strDefaultResRootPath) == 0)
{
CCLOG("Return absolute path( %s ) directly.", pszFileName);
//CCLOG("Return absolute path( %s ) directly.", pszFileName);
return pszFileName;
}
// Already Cached ?
std::map<std::string, std::string>::iterator cacheIter = s_fullPathCache.find(pszFileName);
if (cacheIter != s_fullPathCache.end()) {
CCLOG("Return full path from cache: %s", cacheIter->second.c_str());
//CCLOG("Return full path from cache: %s", cacheIter->second.c_str());
return cacheIter->second;
}
@ -135,7 +135,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
{
// Adding the full path to cache if the file was found.
s_fullPathCache.insert(std::pair<std::string, std::string>(pszFileName, fullpath));
CCLOG("Returning path: %s", fullpath.c_str());
//CCLOG("Returning path: %s", fullpath.c_str());
return fullpath;
}
}
@ -241,7 +241,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
if (!bExistDefaultRootPath)
{
CCLOG("Default root path doesn't exist, adding it.");
//CCLOG("Default root path doesn't exist, adding it.");
m_searchPathArray.push_back(m_strDefaultResRootPath);
}
}

View File

@ -45,7 +45,7 @@ bool CCFileUtils::init()
resourcePath = resourcePath.substr(0, resourcePath.find_last_of("/"));
resourcePath += "/../../../Resources/";
m_strDefaultResRootPath = resourcePath;
CCLOG("DEFAULT RES PATH = %s", m_strDefaultResRootPath.c_str());
//CCLOG("DEFAULT RES PATH = %s", m_strDefaultResRootPath.c_str());
m_searchPathArray.push_back(m_strDefaultResRootPath);
m_searchResolutionsOrderArray.push_back("");
@ -125,7 +125,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
for (std::vector<std::string>::iterator resOrderIter = m_searchResolutionsOrderArray.begin();
resOrderIter != m_searchResolutionsOrderArray.end(); ++resOrderIter) {
CCLOG("\n\nSEARCHING: %s, %s, %s", newFileName.c_str(), resOrderIter->c_str(), searchPathsIter->c_str());
//CCLOG("\n\nSEARCHING: %s, %s, %s", newFileName.c_str(), resOrderIter->c_str(), searchPathsIter->c_str());
fullpath = this->getPathForFilename(newFileName, *resOrderIter, *searchPathsIter);
@ -135,7 +135,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
{
// Adding the full path to cache if the file was found.
s_fullPathCache.insert(std::pair<std::string, std::string>(pszFileName, fullpath));
CCLOG("Returning path: %s", fullpath.c_str());
//CCLOG("Returning path: %s", fullpath.c_str());
return fullpath;
}
}
@ -234,7 +234,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
if (!bExistDefaultRootPath)
{
CCLOG("Default root path doesn't exist, adding it.");
//CCLOG("Default root path doesn't exist, adding it.");
m_searchPathArray.push_back(m_strDefaultResRootPath);
}
}

View File

@ -112,7 +112,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
// Return directly if it's an absolute path.
if (pszFileName[0] == '/')
{
CCLOG("Return absolute path( %s ) directly.", pszFileName);
//CCLOG("Return absolute path( %s ) directly.", pszFileName);
return pszFileName;
}
@ -234,7 +234,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
if (!bExistDefaultRootPath)
{
CCLOG("Default root path doesn't exist, adding it.");
//CCLOG("Default root path doesn't exist, adding it.");
m_searchPathArray.push_back(m_strDefaultResRootPath);
}
}

View File

@ -131,14 +131,14 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
&& (pszFileName[2] == '\\' || pszFileName[2] == '/')
)
{
CCLOG("Probably invoking fullPathForFilename recursively, return the full path: %s", pszFileName);
//CCLOG("Probably invoking fullPathForFilename recursively, return the full path: %s", pszFileName);
return pszFileName;
}
// Already Cached ?
std::map<std::string, std::string>::iterator cacheIter = s_fullPathCache.find(pszFileName);
if (cacheIter != s_fullPathCache.end()) {
CCLOG("Return full path from cache: %s", cacheIter->second.c_str());
//CCLOG("Return full path from cache: %s", cacheIter->second.c_str());
return cacheIter->second;
}
@ -156,7 +156,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
{
// Adding the full path to cache if the file was found.
s_fullPathCache.insert(std::pair<std::string, std::string>(pszFileName, fullpath));
CCLOG("Returning path: %s", fullpath.c_str());
//CCLOG("Returning path: %s", fullpath.c_str());
return fullpath;
}
}
@ -245,7 +245,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
if (!bExistDefaultRootPath)
{
CCLOG("Default root path doesn't exist, adding it.");
//CCLOG("Default root path doesn't exist, adding it.");
m_searchPathArray.push_back(m_strDefaultResRootPath);
}
}