本文整理汇总了C++中lem::Stream::read_uint8方法的典型用法代码示例。如果您正苦于以下问题:C++ Stream::read_uint8方法的具体用法?C++ Stream::read_uint8怎么用?C++ Stream::read_uint8使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lem::Stream
的用法示例。
在下文中一共展示了Stream::read_uint8方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void Lemmatizator::LoadString1( lem::CString *str, lem::Stream &bin, int compression )
{
switch( char_size )
{
case 1:
{
if( compression==0 )
{
bin.read( str->ptr(), lem::CString::max_len );
str->ptr()[lem::CString::max_len]=0;
}
else
{
lem::uint8_t len = bin.read_uint8();
bin.read( str->ptr(), len );
str->ptr()[len]=0;
}
str->calc_hash();
break;
}
default:
{
LEM_STOPIT;
}
}
}
示例2: LoadEncodedString
void Lemmatizator::LoadEncodedString( UCString *str, lem::Stream &bin, int compression )
{
switch( char_size )
{
case 1:
{
lem::uint8_t str8[ lem::CString::max_len+1 ];
if( compression==0 )
{
bin.read( str8, lem::CString::max_len );
str8[lem::CString::max_len]=0;
int i=0;
while( str8[i]!=0 )
{
str->ptr()[i] = i2wchar[str8[i]];
++i;
}
str->ptr()[i]=0;
}
else
{
lem::uint8_t len = bin.read_uint8();
bin.read( str8, len );
str8[len]=0;
for( int i=0; i<len; ++i )
{
str->ptr()[i] = i2wchar[str8[i]];
}
str->ptr()[len]=0;
}
str->calc_hash();
break;
}
default:
{
LEM_STOPIT;
}
}
}