本文整理汇总了C++中CFileBasic::ReadInt方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileBasic::ReadInt方法的具体用法?C++ CFileBasic::ReadInt怎么用?C++ CFileBasic::ReadInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileBasic
的用法示例。
在下文中一共展示了CFileBasic::ReadInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestScratchPadAllocatorReadWrite
void TestScratchPadAllocatorReadWrite(void)
{
MemoryInit();
CScratchPadAllocator cAlloc;
CFileBasic cFile;
CScratchPadAllocator cAllocIn;
int i;
SScratchPadParams sParams;
cFile.Init(MemoryFile());
cFile.Open(EFM_ReadWrite_Create);
cFile.WriteInt(789);
cAlloc.Init(32 KB);
AssertTrue(cAlloc.Write(&cFile));
cFile.WriteInt(124);
cFile.Close();
cAlloc.Kill();
cFile.Open(EFM_Read);
cFile.ReadInt(&i);
AssertInt(789, i);
AssertTrue(cAllocIn.Read(&cFile));
cFile.ReadInt(&i);
AssertInt(124, i);
AssertInt(0, cAllocIn.GetScratchPad()->GetMemorySize());
AssertInt(0, cAllocIn.GetScratchPad()->GetUsedSize());
cAllocIn.GetScratchPad()->GetParams(&sParams);
AssertInt(32 KB, sParams.iChunkSize);
MemoryKill();
}
示例2: CreateSource
CObjectSource* CObjectConverterNative::CreateSource(CAbstractFile* pcFile, char* szFileName)
{
CObjectSourceChunked* pcSourceChunked;
CObjectSourceSimple* pcSourceSimple;
BOOL bResult;
CFileBasic cFile;
int c;
if ((!pcFile) || (!szFileName))
{
return NULL;
}
cFile.Init(pcFile);
bResult = cFile.Open(EFM_Read);
if (!bResult)
{
return NULL;
}
bResult = cFile.ReadInt(&c);
if (!bResult)
{
return NULL;
}
if (c == CHUNKED_OBJECT_FILE)
{
pcSourceChunked = UMalloc(CObjectSourceChunked);
bResult = pcSourceChunked->Init(this, pcFile, szFileName);
if (!bResult)
{
return NULL;
}
return pcSourceChunked;
}
else if (c == BASIC_OBJECT_FILE)
{
pcSourceSimple = UMalloc(CObjectSourceSimple);
pcSourceSimple->Init(this, pcFile, szFileName);
return pcSourceSimple;
}
else
{
return NULL;
}
}