本文整理汇总了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();
}
示例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" );
}
}
}
示例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;
}
}
示例4: Write
void StringStream::Write( DataRef data )
{
output.insert( output.end(), data.Start(), data.End() );
}