-----------------------------------------------------------------------
| 468 | } |
| 469 | //----------------------------------------------------------------------- |
| 470 | bool FileSystemArchive::exists( const String &filename ) |
| 471 | { |
| 472 | String full_path = concatenate_path( mName, filename ); |
| 473 | |
| 474 | #ifdef _OGRE_FILESYSTEM_ARCHIVE_UNICODE |
| 475 | struct _stat64i32 tagStat; |
| 476 | bool ret = ( _wstat( to_wpath( full_path ).c_str(), &tagStat ) == 0 ); |
| 477 | #else |
| 478 | struct stat tagStat; |
| 479 | bool ret = ( stat( full_path.c_str(), &tagStat ) == 0 ); |
| 480 | #endif |
| 481 | |
| 482 | // stat will return true if the filename is absolute, but we need to check |
| 483 | // the file is actually in this archive |
| 484 | if( ret && is_absolute_path( filename.c_str() ) ) |
| 485 | { |
| 486 | // only valid if full path starts with our base |
| 487 | #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WINRT |
| 488 | // case insensitive on windows |
| 489 | String lowerCaseName = mName; |
| 490 | StringUtil::toLowerCase( lowerCaseName ); |
| 491 | ret = Ogre::StringUtil::startsWith( full_path, lowerCaseName, true ); |
| 492 | #else |
| 493 | // case sensitive |
| 494 | ret = Ogre::StringUtil::startsWith( full_path, mName, false ); |
| 495 | #endif |
| 496 | } |
| 497 | |
| 498 | return ret; |
| 499 | } |
| 500 | //--------------------------------------------------------------------- |
| 501 | time_t FileSystemArchive::getModifiedTime( const String &filename ) |
| 502 | { |
nothing calls this directly
no test coverage detected