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


C++ ON_TextLog::SetIndentSize方法代码示例

本文整理汇总了C++中ON_TextLog::SetIndentSize方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_TextLog::SetIndentSize方法的具体用法?C++ ON_TextLog::SetIndentSize怎么用?C++ ON_TextLog::SetIndentSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ON_TextLog的用法示例。


在下文中一共展示了ON_TextLog::SetIndentSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main( int argc, const char *argv[] )
{
  // If you are using OpenNURBS as a Windows DLL, then you MUST use
  // ON::OpenFile() to open the file.  If you are not using OpenNURBS
  // as a Windows DLL, then you may use either ON::OpenFile() or fopen()
  // to open the file.

  const char* example_read_exe_name = 0;
  if ( argc >= 1 && 0 != argv && 0 != argv[0] && 0 != argv[0][0] )
  {
    on_splitpath(argv[0],0,0,&example_read_exe_name,0);
  }
  if ( 0 == example_read_exe_name || 0 == example_read_exe_name[0] )
  {
#if defined(ON_OS_WINDOWS)
    example_read_exe_name = "example_read.exe";
#else
    example_read_exe_name = "example_read";
#endif
  }

  int argi;
  if ( argc < 2 ) 
  {
    print_help(example_read_exe_name);
    return 0;
  }

  // Call once in your application to initialze opennurbs library
  ON::Begin();

  // default dump is to stdout
  ON_TextLog dump_to_stdout;
  dump_to_stdout.SetIndentSize(2);
  ON_TextLog* dump = &dump_to_stdout;
  FILE* dump_fp = 0;

  bool bVerboseTextDump = true;

  bool bChunkDump = false;


  int maximum_directory_depth = 0;

  int file_count = 0;

  for ( argi = 1; argi < argc; argi++ ) 
  {
    const char* arg = argv[argi];

    // check for -out or /out option
    if ( (    0 == strncmp(arg,"-out:",5) || 0 == strncmp(arg,"-out:",5)
#if defined(ON_OS_WINDOWS)
           || 0 == strncmp(arg,"/out:",5) 
#endif
         ) 
         && arg[5] )
    {
      // change destination of dump file
      if ( dump != &dump_to_stdout )
      {
        delete dump;
        dump = 0;
      }
        if ( dump_fp )
        {
          ON::CloseFile(dump_fp);
        }

      const char* sDumpFilename = arg+5;
      FILE* text_fp = ON::OpenFile(sDumpFilename,"w");
      if ( text_fp )
      {
        dump_fp = text_fp;
        dump = new ON_TextLog(dump_fp);
        dump->SetIndentSize(2);
    }

      if ( 0 == dump )
        dump = &dump_to_stdout;

      continue;
    }

    // check for -chunkdump or /chunkdump option
    if (    0 == strcmp(arg,"-C") 
         || 0 == strcmp(arg,"-c") 
         || 0 == strcmp(arg,"-chunk") 
         || 0 == strcmp(arg,"-chunkdump") 
#if defined(ON_OS_WINDOWS)
         || 0 == strcmp(arg,"/C") 
         || 0 == strcmp(arg,"/c") 
         || 0 == strcmp(arg,"/chunk") 
         || 0 == strcmp(arg,"/chunkdump") 
#endif
         )
    {
      bChunkDump = true;
      continue;
    }
//.........这里部分代码省略.........
开发者ID:behollis,项目名称:brlcad-svn-rev65072-gsoc2015,代码行数:101,代码来源:example_read.cpp

示例2: main

int main ( int argc, const char* argv[] )
{
  ON::Begin();

  // default dump is to stdout
  // use the -out:filename.txt option to dump to a file
  ON_TextLog dump_to_stdout;
  ON_TextLog* dump = &dump_to_stdout;
  FILE* dump_fp = 0;

  dump->SetIndentSize(2);

  int argi;
  if ( argc < 2 )
  {
    printf("Syntax: %s [-out:outputfilename.txt] [-terse] file1.3dm file2.3dm ...\n",argv[0]);
    return 0;
  }

  for ( argi = 1; argi < argc; argi++ )
  {
    const char* arg = argv[argi];
    if ( 0 == arg )
      continue;

    // check for -terse option
    if ( 0 == strcmp( arg, "-terse" ) )
    {
      bTerseReport = 1;
      continue;
    }

    // check for -out or /out option
    if ( ( 0 == strncmp(arg,"-out:",5) || 0 == strncmp(arg,"/out:",5) )
         && arg[5] )
    {
      // change destination of dump file
      const char* sDumpFilename = arg+5;
      FILE* text_fp = ON::OpenFile(sDumpFilename,"w");
      if ( text_fp )
      {
        if ( dump_fp )
        {
          delete dump;
          dump = 0;
          ON::CloseFile(dump_fp);
          dump_fp = 0;
        }
        dump_fp = text_fp;
        text_fp = 0;
        dump = new ON_TextLog(dump_fp);
      }
      continue;
    }

    Dump3dmFile( arg, *dump );
    dump->Print("\n\n");
  }

  if ( dump_fp )
  {
    // close the text dump file
    delete dump;
    dump = 0;
    ON::CloseFile( dump_fp );
    dump_fp = 0;
  }

  // OPTIONAL: Call just before your application exits to clean
  //           up opennurbs class definition information.
  //           Opennurbs will not work correctly after ON::End()
  //           is called.
  ON::End();

  return 0;
}
开发者ID:cciechad,项目名称:brlcad,代码行数:76,代码来源:example_dump.cpp


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