當前位置:編程學習大全網 - 網站源碼 - mfc編程中trimleft是什麽函數

mfc編程中trimleft是什麽函數

針對windows平臺的CString::TrimLeft(LPCTSTR lpszTargets)函數,在unix平臺下自己增加該功能函數,下面是微軟提供的TrimLeft函數源碼:

C/C++ code void CString::TrimLeft(LPCTSTR lpszTargets)

{

// if we're not trimming anything, we're not doing any work

if (SafeStrlen(lpszTargets) == 0)

return;

CopyBeforeWrite();

LPCTSTR lpsz = m_pchData;

while (*lpsz != '\0')

{

if (_tcschr(lpszTargets, *lpsz) == NULL)

break;

lpsz = _tcsinc(lpsz);

}

if (lpsz != m_pchData)

{

// fix up data and length

int nDataLength = GetData()->nDataLength - (lpsz - m_pchData);

memmove(m_pchData, lpsz, (nDataLength+1)*sizeof(TCHAR));

GetData()->nDataLength = nDataLength;

}

}

  • 上一篇:虎牙發彈幕有個框是什麽情況
  • 下一篇:摩根大通銀行香港分行SWIFT 代碼
  • copyright 2024編程學習大全網