@ -243,7 +243,7 @@ plRegistryPageNode* plResManager::FindSinglePage(const char* path) const
PageMap : : const_iterator it ;
PageMap : : const_iterator it ;
for ( it = fAllPages . begin ( ) ; it ! = fAllPages . end ( ) ; it + + )
for ( it = fAllPages . begin ( ) ; it ! = fAllPages . end ( ) ; it + + )
{
{
if ( stricmp ( ( it - > second ) - > GetPagePath ( ) , path ) = = 0 )
if ( ( it - > second ) - > GetPagePath ( ) . CompareI ( path ) = = 0 )
return it - > second ;
return it - > second ;
}
}
@ -626,9 +626,9 @@ void plResManager::GetLocationStrings(const plLocation& loc, char* ageBuffer, ch
// Those buffers better be big enough...
// Those buffers better be big enough...
if ( ageBuffer )
if ( ageBuffer )
hsStrcpy ( ageBuffer , info . GetAge ( ) ) ;
hsStrcpy ( ageBuffer , info . GetAge ( ) . c_str ( ) ) ;
if ( pageBuffer )
if ( pageBuffer )
hsStrcpy ( pageBuffer , info . GetPage ( ) ) ;
hsStrcpy ( pageBuffer , info . GetPage ( ) . c_str ( ) ) ;
}
}
bool plResManager : : AddViaNotify ( plRefMsg * msg , plRefFlags : : Type flags )
bool plResManager : : AddViaNotify ( plRefMsg * msg , plRefFlags : : Type flags )
@ -1041,7 +1041,7 @@ public:
virtual bool EatPage ( plRegistryPageNode * page )
virtual bool EatPage ( plRegistryPageNode * page )
{
{
if ( stricmp ( page - > GetPageInfo ( ) . GetAge ( ) , fAgeName ) = = 0 )
if ( page - > GetPageInfo ( ) . GetAge ( ) . CompareI ( fAgeName ) = = 0 )
{
{
fResMgr - > LoadPageKeys ( page ) ;
fResMgr - > LoadPageKeys ( page ) ;
plKeyCollector collector ( fKeys ) ;
plKeyCollector collector ( fKeys ) ;
@ -1176,23 +1176,23 @@ void plResManager::PageInRoom(const plLocation& page, uint16_t objClassToRef, pl
return ;
return ;
}
}
kResMgrLog ( 2 , ILog ( 2 , " ...Found, page is ID'd as %s>%s " , pageNode - > GetPageInfo ( ) . GetAge ( ) , pageNode - > GetPageInfo ( ) . GetPage ( ) ) ) ;
kResMgrLog ( 2 , ILog ( 2 , " ...Found, page is ID'd as %s>%s " , pageNode - > GetPageInfo ( ) . GetAge ( ) . c_str ( ) , pageNode - > GetPageInfo ( ) . GetPage ( ) . c_str ( ) ) ) ;
// Step 0.5: Verify the page, just to make sure we really should be loading it
// Step 0.5: Verify the page, just to make sure we really should be loading it
PageCond cond = pageNode - > GetPageCondition ( ) ;
PageCond cond = pageNode - > GetPageCondition ( ) ;
if ( cond ! = kPageOk )
if ( cond ! = kPageOk )
{
{
std : : s tring condStr = " Checksum invalid " ;
plS tring condStr = " Checksum invalid " ;
if ( cond = = kPageTooNew )
if ( cond = = kPageTooNew ) {
condStr = " Page Version too new " ;
condStr = " Page Version too new " ;
else
} else if ( cond = = kPageOutOfDate ) {
if ( cond = = kPageOutOfDate )
condStr = " Page Version out of date " ;
condStr = " Page Version out of date " ;
}
kResMgrLog ( 1 , ILog ( 1 , " ...IGNORING pageIn request; verification failed! (%s) " , condStr . c_str ( ) ) ) ;
kResMgrLog ( 1 , ILog ( 1 , " ...IGNORING pageIn request; verification failed! (%s) " , condStr . c_str ( ) ) ) ;
plString msg = plString : : Format ( " Data Problem: Age:%s Page:%s Error:%s " ,
plString msg = plString : : Format ( " Data Problem: Age:%s Page:%s Error:%s " ,
pageNode - > GetPageInfo ( ) . GetAge ( ) , pageNode - > GetPageInfo ( ) . GetPage ( ) , condStr . c_str ( ) ) ;
pageNode - > GetPageInfo ( ) . GetAge ( ) . c_str ( ) , pageNode - > GetPageInfo ( ) . GetPage ( ) . c_str ( ) , condStr . c_str ( ) ) ;
hsMessageBox ( msg . c_str ( ) , " Error " , hsMessageBoxNormal , hsMessageBoxIconError ) ;
hsMessageBox ( msg . c_str ( ) , " Error " , hsMessageBoxNormal , hsMessageBoxIconError ) ;
hsRefCnt_SafeUnRef ( refMsg ) ;
hsRefCnt_SafeUnRef ( refMsg ) ;
@ -1250,7 +1250,7 @@ void plResManager::PageInRoom(const plLocation& page, uint16_t objClassToRef, pl
readRoomTime = hsTimer : : GetFullTickCount ( ) - readRoomTime ;
readRoomTime = hsTimer : : GetFullTickCount ( ) - readRoomTime ;
plStatusLog : : AddLineS ( " readtimings.log " , plStatusLog : : kWhite , " ----- Reading page %s>%s took %.1f ms " ,
plStatusLog : : AddLineS ( " readtimings.log " , plStatusLog : : kWhite , " ----- Reading page %s>%s took %.1f ms " ,
pageNode - > GetPageInfo ( ) . GetAge ( ) , pageNode - > GetPageInfo ( ) . GetPage ( ) ,
pageNode - > GetPageInfo ( ) . GetAge ( ) . c_str ( ) , pageNode - > GetPageInfo ( ) . GetPage ( ) . c_str ( ) ,
hsTimer : : FullTicksToMs ( readRoomTime ) ) ;
hsTimer : : FullTicksToMs ( readRoomTime ) ) ;
}
}
}
}
@ -1275,7 +1275,7 @@ public:
}
}
virtual bool EatPage ( plRegistryPageNode * page )
virtual bool EatPage ( plRegistryPageNode * page )
{
{
if ( stricmp ( page - > GetPageInfo ( ) . GetAge ( ) , fAgeName ) = = 0 )
if ( page - > GetPageInfo ( ) . GetAge ( ) . CompareI ( fAgeName ) = = 0 )
{
{
plUoid uoid ( page - > GetPageInfo ( ) . GetLocation ( ) , 0 , " " ) ;
plUoid uoid ( page - > GetPageInfo ( ) . GetLocation ( ) , 0 , " " ) ;
fLocations . push_back ( uoid . GetLocation ( ) ) ;
fLocations . push_back ( uoid . GetLocation ( ) ) ;
@ -1406,7 +1406,7 @@ static void ICatPageNames(hsTArray<plRegistryPageNode*>& pages, char* buf, int b
break ;
break ;
}
}
const char * pagePath = pages [ i ] - > GetPagePath ( ) ;
const char * pagePath = pages [ i ] - > GetPagePath ( ) . c_str ( ) ;
const char * pageFile = plFileUtils : : GetFileName ( pagePath ) ;
const char * pageFile = plFileUtils : : GetFileName ( pagePath ) ;
if ( strlen ( buf ) + strlen ( pageFile ) > bufSize - 5 )
if ( strlen ( buf ) + strlen ( pageFile ) > bufSize - 5 )
@ -1578,7 +1578,7 @@ static void sIReportLeak(plKeyImp* key, plRegistryPageNode* page)
if ( ! alreadyDone )
if ( ! alreadyDone )
{
{
// Print out page header
// Print out page header
hsStatusMessageF ( " Leaks in page %s>%s[%08x]: \n " , lastPage - > GetPageInfo ( ) . GetAge ( ) , lastPage - > GetPageInfo ( ) . GetPage ( ) , lastPage - > GetPageInfo ( ) . GetLocation ( ) . GetSequenceNumber ( ) ) ;
hsStatusMessageF ( " Leaks in page %s>%s[%08x]: \n " , lastPage - > GetPageInfo ( ) . GetAge ( ) . c_str ( ) , lastPage - > GetPageInfo ( ) . GetPage ( ) . c_str ( ) , lastPage - > GetPageInfo ( ) . GetLocation ( ) . GetSequenceNumber ( ) ) ;
alreadyDone = true ;
alreadyDone = true ;
}
}
@ -1650,14 +1650,13 @@ plRegistryPageNode* plResManager::FindPage(const plLocation& location) const
//// FindPage ////////////////////////////////////////////////////////////////
//// FindPage ////////////////////////////////////////////////////////////////
plRegistryPageNode * plResManager : : FindPage ( const char * age , const char * page ) const
plRegistryPageNode * plResManager : : FindPage ( const plString & age , const plString & page ) const
{
{
PageMap : : const_iterator it ;
PageMap : : const_iterator it ;
for ( it = fAllPages . begin ( ) ; it ! = fAllPages . end ( ) ; + + it )
for ( it = fAllPages . begin ( ) ; it ! = fAllPages . end ( ) ; + + it )
{
{
const plPageInfo & info = ( it - > second ) - > GetPageInfo ( ) ;
const plPageInfo & info = ( it - > second ) - > GetPageInfo ( ) ;
if ( stricmp ( info . GetAge ( ) , age ) = = 0 & &
if ( info . GetAge ( ) . CompareI ( age ) = = 0 & & info . GetPage ( ) . CompareI ( page ) = = 0 )
stricmp ( info . GetPage ( ) , page ) = = 0 )
return it - > second ;
return it - > second ;
}
}
@ -1760,7 +1759,7 @@ bool plResManager::IterateKeys(plRegistryKeyIterator* iterator, const plLocation
//// IteratePages ////////////////////////////////////////////////////////////
//// IteratePages ////////////////////////////////////////////////////////////
// Iterate through all LOADED pages
// Iterate through all LOADED pages
bool plResManager : : IteratePages ( plRegistryPageIterator * iterator , const char * ageToRestrictTo )
bool plResManager : : IteratePages ( plRegistryPageIterator * iterator , const plString & ageToRestrictTo )
{
{
ILockPages ( ) ;
ILockPages ( ) ;
@ -1771,7 +1770,7 @@ bool plResManager::IteratePages(plRegistryPageIterator* iterator, const char* ag
if ( page - > GetPageInfo ( ) . GetLocation ( ) = = plLocation : : kGlobalFixedLoc )
if ( page - > GetPageInfo ( ) . GetLocation ( ) = = plLocation : : kGlobalFixedLoc )
continue ;
continue ;
if ( ! ageToRestrictTo | | stricmp ( page - > GetPageInfo ( ) . GetAge ( ) , ageToRestrictTo ) = = 0 )
if ( ageToRestrictTo . IsNull ( ) | | page - > GetPageInfo ( ) . GetAge ( ) . CompareI ( ageToRestrictTo ) = = 0 )
{
{
if ( ! iterator - > EatPage ( page ) )
if ( ! iterator - > EatPage ( page ) )
{
{