当前位置: 首页>>代码示例>>C++>>正文


C++ ON_BinaryArchive::CurrentPosition方法代码示例

本文整理汇总了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();
//.........这里部分代码省略.........
开发者ID:cciechad,项目名称:brlcad,代码行数:101,代码来源:example_dump.cpp


注:本文中的ON_BinaryArchive::CurrentPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。