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


C++ DataRef::Start方法代码示例

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


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

示例1: WriteOneByOneAndEnd

void WriteOneByOneAndEnd( Stream& stream, DataRef data )
{
  for ( const uint8_t* it = data.Start(); it != data.End(); it++ )
  {
    stream.Write( DataRef( it, it + 1 ) );
    stream.Write( DataRef() );
  }

  stream.End();
}
开发者ID:briangreenery,项目名称:bfarchive,代码行数:10,代码来源:TestUtility.cpp

示例2: Write

void ArchiveReader::Write( DataRef data )
{
  const uint8_t* start = data.Start();
  const uint8_t* end = data.End();

  while ( start != end )
  {
    switch ( m_state )
    {
    case STATE_PATH_ENCODING:
      start = PathEncoding( start, end );
      break;

    case STATE_FILE_LENGTH_LENGTH:
      start = FileLengthLength( start, end );
      break;

    case STATE_PATH_LENGTH:
      start = PathLength( start, end );
      break;

    case STATE_PATH:
      start = Path( start, end );
      break;

    case STATE_DATE_LENGTH:
      start = DateLength( start, end );
      break;

    case STATE_DATE:
      start = Date( start, end );
      break;

    case STATE_FILE_LENGTH:
      start = FileLength( start, end );
      break;

    case STATE_FILE:
      start = File( start, end );
      break;

    case STATE_DONE:
      throw Error( "More data received after the end of the archive" );
    }
  }
}
开发者ID:rodgier,项目名称:bfarchive,代码行数:46,代码来源:ArchiveReader.cpp

示例3: HasDotDotComponent

static bool HasDotDotComponent( DataRef path )
{
  const uint8_t* start = path.Start();
  const uint8_t* end = path.End();

  while ( true )
  {
    const uint8_t* slash = std::find( start, end, '/' );

    if ( DataRef( start, slash ) == DataRef( ".." ) )
      return true;

    if ( slash == end )
      return false;

    start = slash + 1;
  }
}
开发者ID:rodgier,项目名称:bfarchive,代码行数:18,代码来源:ArchiveReader.cpp

示例4: Write

void StringStream::Write( DataRef data )
{
  output.insert( output.end(), data.Start(), data.End() );
}
开发者ID:briangreenery,项目名称:bfarchive,代码行数:4,代码来源:TestUtility.cpp


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