本文整理汇总了C++中TBuf8::LowerCase方法的典型用法代码示例。如果您正苦于以下问题:C++ TBuf8::LowerCase方法的具体用法?C++ TBuf8::LowerCase怎么用?C++ TBuf8::LowerCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBuf8
的用法示例。
在下文中一共展示了TBuf8::LowerCase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadROM
void CPicoServSession::loadROM()
{
TInt res;
const TAny* pD=Message().Ptr0();
// TInt desLen=Message().Client().GetDesLength(pD);
if(rom_data) {
// save SRAM for previous ROM
if(currentConfig.iFlags & 1)
saveLoadGame(0, 1);
}
RomFileName = 0;
if(rom_data) {
free(rom_data);
rom_data = 0;
}
// read the contents of the client pointer into a TPtr.
static TBuf8<KMaxFileName> writeBuf;
TRAP(res,Message().ReadL(pD,writeBuf));
if (res!=KErrNone) {
PanicClient(EBadDescriptor);
return;
}
// detect wrong extensions (.srm and .mds)
TBuf8<5> ext;
ext.Copy(writeBuf.Right(4));
ext.LowerCase();
if(!strcmp((char *)ext.PtrZ(), ".srm") || !strcmp((char *)ext.PtrZ(), "s.gz") || // .mds.gz
!strcmp((char *)ext.PtrZ(), ".mds")) {
User::Leave(3);
return;
}
FILE *rom = fopen((char *) writeBuf.PtrZ(), "rb");
if(!rom) {
DEBUGPRINT(_L("failed to open rom."));
User::Leave(1);
return;
}
unsigned int rom_size = 0;
// zipfile support
if(!strcmp((char *)ext.PtrZ(), ".zip")) {
fclose(rom);
res = CartLoadZip((const char *) writeBuf.PtrZ(), &rom_data, &rom_size);
if(res) {
User::Leave(res);
return;
}
} else {
if( (res = PicoCartLoad(rom, &rom_data, &rom_size)) ) {
DEBUGPRINT(_L("PicoCartLoad() failed."));
fclose(rom);
User::Leave(2);
return;
}
fclose(rom);
}
// detect wrong files (Pico crashes on very small files), also see if ROM EP is good
if(rom_size <= 0x200 || strncmp((char *)rom_data, "Pico", 4) == 0 ||
((*(TUint16 *)(rom_data+4)<<16)|(*(TUint16 *)(rom_data+6))) >= (int)rom_size) {
free(rom_data);
rom_data = 0;
User::Leave(3); // not a ROM
}
DEBUGPRINT(_L("PicoCartInsert(0x%08X, %d);"), rom_data, rom_size);
if(PicoCartInsert(rom_data, rom_size)) {
User::Leave(2);
return;
}
pico_was_reset = 1;
// global ROM file name for later use
RomFileName = (const char *) writeBuf.PtrZ();
// load SRAM for this ROM
if(currentConfig.iFlags & 1)
saveLoadGame(1, 1);
// debug
#ifdef __DEBUG_PRINT
TInt cells = User::CountAllocCells();
TInt mem;
User::AllocSize(mem);
DEBUGPRINT(_L("comm: cels=%d, size=%d KB"), cells, mem/1024);
gamestate = PGS_DebugHeap;
gamestate_prev = PGS_Running;
#else
gamestate = PGS_Running;
#endif
}