3,055
社区成员
发帖
与我相关
我的任务
分享
void CMarkup::_ParseMetaChar(LPTSTR& pstrText, LPTSTR& pstrDest)
{
if( pstrText[0] == _T('a') && pstrText[1] == _T('m') && pstrText[2] == _T('p') && pstrText[3] == _T(';') ) {
*pstrDest++ = _T('&');
pstrText += 4;
}
else if( pstrText[0] == _T('l') && pstrText[1] == _T('t') && pstrText[2] == _T(';') ) {
*pstrDest++ = _T('<');
pstrText += 3;
}
else if( pstrText[0] == _T('g') && pstrText[1] == _T('t') && pstrText[2] == _T(';') ) {
*pstrDest++ = _T('>');
pstrText += 3;
}
else if( pstrText[0] == _T('q') && pstrText[1] == _T('u') && pstrText[2] == _T('o') && pstrText[3] == _T('t') && pstrText[4] == _T(';') ) {
*pstrDest++ = _T('\"');
pstrText += 5;
}
else if( pstrText[0] == _T('a') && pstrText[1] == _T('p') && pstrText[2] == _T('o') && pstrText[3] == _T('s') && pstrText[4] == _T(';') ) {
*pstrDest++ = _T('\'');
pstrText += 5;
}
else {
*pstrDest++ = _T('&');
}
}