本文整理汇总了C++中FileStream::GetPos方法的典型用法代码示例。如果您正苦于以下问题:C++ FileStream::GetPos方法的具体用法?C++ FileStream::GetPos怎么用?C++ FileStream::GetPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileStream
的用法示例。
在下文中一共展示了FileStream::GetPos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DecompressBIFC
DataStream* BIFImporter::DecompressBIFC(DataStream* compressed, const char* path)
{
print( "Decompressing\n" );
if (!core->IsAvailable( PLUGIN_COMPRESSION_ZLIB ))
return NULL;
PluginHolder<Compressor> comp(PLUGIN_COMPRESSION_ZLIB);
ieDword unCompBifSize;
compressed->ReadDword( &unCompBifSize );
print( "\nDecompressing file: [..........]" );
fflush(stdout);
FileStream out;
if (!out.Create(path)) {
printMessage("BIFImporter", "Cannot write %s.\n", RED, path);
return NULL;
}
ieDword finalsize = 0;
int laststep = 0;
while (finalsize < unCompBifSize) {
ieDword complen, declen;
compressed->ReadDword( &declen );
compressed->ReadDword( &complen );
if (comp->Decompress( &out, compressed, complen ) != GEM_OK) {
return NULL;
}
finalsize = out.GetPos();
if (( int ) ( finalsize * ( 10.0 / unCompBifSize ) ) != laststep) {
laststep++;
print( "\b\b\b\b\b\b\b\b\b\b\b" );
int l;
for (l = 0; l < laststep; l++)
print( "|" );
for (; l < 10; l++)//l starts from laststep
print( "." );
print( "]" );
fflush(stdout);
}
}
print( "\n" );
out.Close(); // This is necesary, since windows won't open the file otherwise.
return FileStream::OpenFile(path);
}