本文整理汇总了C++中ON_BinaryArchive::CurrentPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_BinaryArchive::CurrentPosition方法的具体用法?C++ ON_BinaryArchive::CurrentPosition怎么用?C++ ON_BinaryArchive::CurrentPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_BinaryArchive
的用法示例。
在下文中一共展示了ON_BinaryArchive::CurrentPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
unsigned int Dump3dmChunk( ON_BinaryArchive& file, ON_TextLog& dump, int recursion_depth )
{
BOOL bShortChunk = FALSE;
const size_t offset0 = file.CurrentPosition();
unsigned int typecode = 0;
int value;
BOOL rc = file.BeginRead3dmChunk( &typecode, &value );
if (!rc) {
ErrorReport(offset0,"BeginRead3dmChunk() failed.",dump);
}
else {
if ( !typecode ) {
ErrorReport(offset0,"BeginRead3dmChunk() returned typecode = 0.",dump);
file.EndRead3dmChunk();
return 0;
}
else {
if ( 0 == recursion_depth )
{
dump.Print("\n");
}
bShortChunk = (0 != (typecode & TCODE_SHORT));
if ( bShortChunk )
{
dump.Print("%6d: %08X %s: value = %d (%08X)\n", offset0, typecode, TypeCodeString(typecode), value, value );
}
else
{
// long chunk value = length of chunk data
if ( value < 0 )
{
ErrorReport(offset0,"BeginRead3dmChunk() returned length < 0.",dump);
file.EndRead3dmChunk();
return 0;
}
dump.Print("%6d: %08X %s: length = %d bytes\n", offset0, typecode, TypeCodeString(typecode), value );
}
int major_userdata_version = -1;
int minor_userdata_version = -1;
switch( typecode )
{
case TCODE_PROPERTIES_TABLE:
case TCODE_SETTINGS_TABLE:
case TCODE_BITMAP_TABLE:
case TCODE_MATERIAL_TABLE:
case TCODE_LAYER_TABLE:
case TCODE_GROUP_TABLE:
case TCODE_LIGHT_TABLE:
case TCODE_FONT_TABLE:
case TCODE_DIMSTYLE_TABLE:
case TCODE_HATCHPATTERN_TABLE:
case TCODE_LINETYPE_TABLE:
case TCODE_TEXTURE_MAPPING_TABLE:
case TCODE_HISTORYRECORD_TABLE:
case TCODE_USER_TABLE:
case TCODE_INSTANCE_DEFINITION_TABLE:
case TCODE_OBJECT_TABLE:
// start of a table
{
dump.PushIndent();
unsigned int record_typecode = 0;
for (;;) {
record_typecode = Dump3dmChunk( file, dump, recursion_depth+1 );
if ( !record_typecode ) {
break;
}
if ( TCODE_ENDOFTABLE == record_typecode ) {
break;
}
}
dump.PopIndent();
}
break;
case TCODE_BITMAP_RECORD:
{
dump.PushIndent();
unsigned int bitmap_chunk_typecode = Dump3dmChunk( file, dump, recursion_depth+1 );
if ( !typecode )
typecode = bitmap_chunk_typecode;
dump.PopIndent();
}
break;
case TCODE_MATERIAL_RECORD:
{
dump.PushIndent();
unsigned int material_chunk_typecode = Dump3dmChunk( file, dump, recursion_depth+1 );
if ( !typecode )
typecode = material_chunk_typecode;
dump.PopIndent();
}
break;
case TCODE_LAYER_RECORD:
{
dump.PushIndent();
//.........这里部分代码省略.........