Linux fix missing file -> rename dir loadSceneEditorFileTest to LoadScene...; add string::npos; const correctness

This commit is contained in:
Daniel T. Borelli 2014-01-04 19:26:16 -03:00
parent 08dad98592
commit 8ffb05b6c9
7 changed files with 5 additions and 5 deletions

View File

@ -319,7 +319,7 @@ bool AssetsManager::uncompress()
return false;
}
string fullPath = _storagePath + fileName;
const string fullPath = _storagePath + fileName;
// Check if this entry is a directory or a file.
const size_t filenameLength = strlen(fileName);
@ -339,15 +339,15 @@ bool AssetsManager::uncompress()
//There are not directory entry in some case.
//So we need to test whether the file directory exists when uncompressing file entry
//, if does not exist then create directory
string fileNameStr(fileName);
const string fileNameStr(fileName);
size_t startIndex=0;
size_t index=fileNameStr.find("/",startIndex);
while(index!=-1)
while(index != std::string::npos)
{
string dir=_storagePath+fileNameStr.substr(0,index);
const string dir=_storagePath+fileNameStr.substr(0,index);
FILE *out = fopen(dir.c_str(), "r");
@ -501,7 +501,7 @@ int assetsManagerProgressFunc(void *ptr, double totalToDownload, double nowDownl
bool AssetsManager::downLoad()
{
// Create a file to save package.
string outFileName = _storagePath + TEMP_PACKAGE_FILE_NAME;
const string outFileName = _storagePath + TEMP_PACKAGE_FILE_NAME;
FILE *fp = fopen(outFileName.c_str(), "wb");
if (! fp)
{