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


C++ String::Copy方法代码示例

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


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

示例1: ProcessToken


//.........这里部分代码省略.........

      // Skip the appropriate number of lines
      while (repeatCount--)
         inputLine.ReadLine(input);

      inputPos = 0;

      // Separators are optional, so we might already be at the next field
      if (format[formatPos] == ',' || format[formatPos] || ')')
         FinishField();

      return false;
      }

   // Check that we haven't encountered a rare, but unsupported input type
   if (format[formatPos] == 'Q' || format[formatPos] == 'P' || format[formatPos] == 'B')
      {
      formatPos++;

      int problemStart = formatPos;

      while (format[formatPos] != ',' && format[formatPos] != ')' && format[formatPos] != '/')
         formatPos++;

      error("Unsupported pattern in FORMAT statement\n\n"
            "Statement \"%s\" includes unsupporterd pattern '%s'\n",
            (const char *) format,
            (const char *) format.SubStr(problemStart, formatPos - problemStart));
      }

   if (format[formatPos] == ':')
      {
      formatPos++;

      if (format[formatPos] == ',' || format[formatPos] || ')')
         FinishField();

      repeatCount = 0;

      endOfPattern = true;

      return false;
      }

   // All the other types we recognize include a width specifier

   // Identify the location of the type specifier
   int typeStart = formatPos;

   while (CharacterFollows())
      formatPos++;

   int typeLen = formatPos - typeStart;

   // Retrieve the field width
   int width = GetIntegerFromFormat();

   if (width == 0)
      error("Unrecognized FORMAT statement\n\n"
            "Statement \"%s\" is missing a width specifier for a field of type '%s'\n",
            (const char *) format, (const char *) format.SubStr(typeStart, typeLen));

   // Check for horizontal tab character
   if (format[typeStart] == 'T')
      {
      // Move left by a specified number of characters
      if (format[typeStart + 1] == 'L')
         inputPos = width > inputPos ? 0 : inputPos - width;
      // Move right by a specified number of characters
      else if (format[typeStart + 1] == 'R')
         inputPos += width;
      // Or simply set the appropriate horizontal position
      else
         inputPos = width;

      repeatCount--;

      if (repeatCount)
         formatPos = repeatPos;
      else
         FinishField();

      return false;
      }

   // Assume that if we got here, we are looking at a data field!
   field.Copy(inputLine, inputPos, width);
   field.Trim();

   inputPos += width;

   repeatCount--;

   if (repeatCount)
      formatPos = repeatPos;
   else
      FinishField();

   return true;
   }
开发者ID:mkanai,项目名称:ChunkChromosome,代码行数:101,代码来源:FortranFormat.cpp

示例2: _LoadAsync

void BBDataBuffer::_LoadAsync( const String &cpath,BBThread *thread ){

	String path=cpath.Copy();
	
	if( _Load( path ) ) thread->SetResult( this );
}
开发者ID:bruZard,项目名称:amigamonkey,代码行数:6,代码来源:databuffer.cpp


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