AddressType StringReader::read(ByteType* Buf, AddressType Size) { if (Cursor >= Str.size()) return 0; AddressType Available = Str.size() - Cursor; if (Available > Size) Available = Size; for (AddressType i = 0; i < Available; ++i) *(Buf++) = ByteType(Str[Cursor++]); return Available; }
/* ==================================================================== */ long scDBCSDetector::StrLen( const char* str ) const { long len = 0; for ( ; *str; ) { switch( ByteType ( *str++ ) ) { case eOnlyByte: case eLastByte: len++; break; } } return len; }