本文整理汇总了C++中CStr::Del方法的典型用法代码示例。如果您正苦于以下问题:C++ CStr::Del方法的具体用法?C++ CStr::Del怎么用?C++ CStr::Del使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStr
的用法示例。
在下文中一共展示了CStr::Del方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Decode_GetNextLine
bool COrgOp::Decode_GetNextLine( CStr &roDst, CStr &roSrc ) const
{
int j;
j = roSrc.Find( 0, ORG_OP_DELIM );
if( j < 0 )
return false;
roSrc.Del( 0, ++j );
j = roSrc.Find( 0, ORG_OP_NEWLINE );
if( j < 0 )
return false;
roDst = roSrc.GetSub( 0, j );
roSrc.Del( 0, j+sizeof( ORG_OP_NEWLINE ) );
ORG_OP_LOG( "line: %s\n", roDst.GetData() );
return true;
}
示例2: Decode_GetNextToken
bool COrgOp::Decode_GetNextToken( CStr &roDst, CStr &roSrc ) const
{
int j = roSrc.Find( 0, ORG_OP_DELIM );
if( j < 0 )
return false;
roDst = roSrc.GetSub( 0, j );
roSrc.Del( 0, j+1 ); // ORG_OP_DELIM auch löschen
ORG_OP_LOG( "token: %s\n", roDst.GetData() );
return true;
}
示例3: RemoveLeadingSpace
bool CPrsBDF::RemoveLeadingSpace( CStr &roStr )
{
static const char *acSpace_ = " \t";
int iPos = roStr.FindVecInv( 0, acSpace_ );
if( iPos >= 0 )
{
roStr.Del( 0, iPos );
return true;
}
return false;
}
示例4: RemoveNextWord
bool CPrsBDF::RemoveNextWord( CStr &roStr )
{
if( !roStr.GetSize() )
return false;
static const char *acSpace_ = " \t";
RemoveLeadingSpace( roStr );
int iPos = roStr.FindVec( 0, acSpace_ );
if( iPos < 0 )
iPos = roStr.GetSize();
roStr.Del( 0, iPos );
RemoveLeadingSpace( roStr );
return true;
}
示例5: Parse
bool CPrsBDF::Parse( const char *pcFont )
{
#define TOK(T) TPairTokenNameID( #T, PBDF_TOKEN_##T )
static const TPairTokenNameID m_aoToken_[] =
{
TOK( STARTFONT ),
TOK( COMMENT ),
TOK( CONTENTVERSION ),
TOK( FONT ),
TOK( SIZE ),
TOK( FONTBOUNDINGBOX ),
TOK( METRICSSET ),
TOK( SWIDTH ),
TOK( DWIDTH ),
TOK( SWIDTH1 ),
TOK( DWIDTH1 ),
TOK( VVECTOR ),
TOK( STARTPROPERTIES ),
TOK( ENDPROPERTIES ),
TOK( CHARS ),
TOK( STARTCHAR ),
TOK( ENCODING ),
TOK( BBX ),
TOK( BITMAP ),
TOK( ENDCHAR ),
TOK( ENDFONT )
};
static const unsigned int uiTokenNum = sizeof( m_aoToken_ ) / sizeof( TPairTokenNameID );
CStr oStrFontFile( pcFont );
const int iFontSize = oStrFontFile.GetSize();
int iPropertiesStartPos = -1;
CGlyph oGylphNew;
CGlyph *poGlyph = &m_oGlyphDefault;
bool bIsReadingChar = false;
Reset();
PBDF_LOG( "parse: start\n" );
int iPos = 0;
while( iPos < iFontSize )
{
int iEndOfLine = oStrFontFile.Find( iPos, PBDF_NEWLINE );
if( iEndOfLine < 0 )
iEndOfLine = iFontSize;
CStr oStrLine = oStrFontFile.GetSub( iPos, iEndOfLine - iPos );
RemoveLeadingSpace( oStrLine );
//PBDF_LOG( "line: %s", oStrLine.GetData() );
//PBDF_LOG( "line_size: %s", oStrLine.GetSize() );
unsigned int uiTokenNext = PBDF_TOKEN_NONE;
for( unsigned int t=0; t<uiTokenNum; ++t )
{
CStr oStrToken = m_aoToken_[t].GetFirst() ;
const unsigned int uiTokenSize = oStrToken.GetSize();
//PBDF_LOG( "token: %s", oStrToken.GetData() );
int iPosToken = oStrLine.Find( 0, oStrToken );
if( iPosToken != 0 )
continue;
// Danach müssen Leerzeichen oder das Ende folgen!
const unsigned int uiPosNext = iPosToken + uiTokenSize;
if( uiPosNext < oStrLine.GetSize() )
{
const char cNext = oStrLine[ uiPosNext ];
if( !( cNext == ' ' || cNext == '\t' ) )
continue;
}
if( iPosToken >= 0 )
{
oStrLine.Del( 0, uiTokenSize );
RemoveLeadingSpace( oStrLine );
uiTokenNext = m_aoToken_[t].GetSecond();
PBDF_LOG( "token: %s\n", oStrToken.GetData() );
break;
}
}
if( uiTokenNext != PBDF_TOKEN_NONE )
{
switch( uiTokenNext )
{
case PBDF_TOKEN_STARTFONT:
ReadValue( oStrLine, &m_dVersion );
PBDF_LOG( "version: %g\n", m_dVersion );
break;
case PBDF_TOKEN_COMMENT:
break;
case PBDF_TOKEN_CONTENTVERSION: // optional
ReadValue( oStrLine, &m_iContentVersion );
PBDF_LOG( "content_version: %d\n", m_iContentVersion );
break;
case PBDF_TOKEN_FONT:
ReadValue( oStrLine, &m_oStrFont );
//.........这里部分代码省略.........