本文整理汇总了C++中CString::Remove方法的典型用法代码示例。如果您正苦于以下问题:C++ CString::Remove方法的具体用法?C++ CString::Remove怎么用?C++ CString::Remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CString
的用法示例。
在下文中一共展示了CString::Remove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
BOOL CXmlDocument::Load(LPCTSTR lpszFileName)
{
CWaitCursor waitCursor;
CString strXML;
try
{
CFile inputFile(lpszFileName, CFile::modeRead);
DWORD dwLength = inputFile.GetLength();
//inputFile.Read(strXML.GetBuffer(dwLength), dwLength);
LPTSTR buffer = strXML.GetBuffer(dwLength);
inputFile.Read(buffer, dwLength);
buffer[dwLength] = 0;
strXML.ReleaseBuffer();
inputFile.Close();
}
catch(CFileException *ex)
{
ex->Delete();
return FALSE;
}
// remove endofline and tabs
strXML.Remove('\n');
strXML.Remove('\r');
strXML.Remove('\t');
return Parse(strXML);
}
示例2: FormatNumber
CString FormatNumber(CString number) {
CString numberFormated = number;
pjsua_acc_id acc_id;
pj_str_t pj_uri;
bool isLocal = SelectSIPAccount(number,acc_id,pj_uri) && acc_id == account_local;
if (!isLocal) {
BOOL isDigits = TRUE;
for (int i=0;i<number.GetLength();i++)
{
if ( (number[i]>'9' || number[i]<'0') && number[i]!='*' && number[i]!='#' && number[i]!='.' && number[i]!='-' && number[i]!='(' && number[i]!=')' && number[i]!=' ' && number[0]!='+')
{
isDigits = FALSE;
break;
}
}
if (isDigits) {
numberFormated.Remove('.');
numberFormated.Remove('-');
numberFormated.Remove('(');
numberFormated.Remove(')');
numberFormated.Remove(' ');
}
}
return GetSIPURI(numberFormated,true,isLocal);
}
示例3: startFiltering
void Filter::startFiltering(){
editMessageBox.EnableWindow(false);
editCommentBox.EnableWindow(false);
comboEnabled.EnableWindow(false);
comboOptions.EnableWindow(false);
GetDlgItem(IDC_BUTTON6)->EnableWindow(false);
GetDlgItem(IDC_BUTTON8)->EnableWindow(false);
GetDlgItem(IDC_BUTTON9)->EnableWindow(false);
amtOfExcludes = 0;
amtOfIncludes = 0;
uEdit = 0;
editMessageBox.SetWindowTextA("");
editCommentBox.SetWindowTextA("");
comboEnabled.SetCurSel(1);
comboOptions.SetCurSel(1);
for(int i = 0; i < listControl.GetItemCount(); i++){
if(listControl.GetItemText(i,0).Compare("Enabled") == 0){
if(listControl.GetItemText(i,2).Compare("Include") == 0){
CString data = listControl.GetItemText(i,1);
data.Remove(' ');
listOfIncludes[amtOfIncludes] = data;
amtOfIncludes++;
}else{
CString data = listControl.GetItemText(i,1);
data.Remove(' ');
listOfExcludes[amtOfExcludes] = data;
amtOfExcludes++;
}
}
}
}
示例4: StripMessageOfFontCodes
CString CIrcWnd::StripMessageOfFontCodes(CString sTemp)
{
sTemp = StripMessageOfColorCodes(sTemp);
sTemp.Remove(_T('\002')); // 0x02 - BOLD
//sTemp.Remove(_T('\003')); // 0x03 - COLOUR
sTemp.Remove(_T('\017')); // 0x0f - RESET
sTemp.Remove(_T('\026')); // 0x16 - REVERSE/INVERSE was once italic?
sTemp.Remove(_T('\037')); // 0x1f - UNDERLINE
return sTemp;
}
示例5:
bool operator < (const SortedACE& b)
{
CString first = name;
CString second = b.name;
first.Remove('*');
second.Remove('*');
return first < second;
}
示例6: CreateLogName
BOOL CLogFactory::CreateLogName(BSTR AppName,
BSTR Configue,
BSTR Section,
LONG FileType,
CString &strLogName)
{
CString strError;
CString strAppPath(AppName);
CString strFileName(Configue);
CString strSection(Section);
if (!IsFileExisted(strAppPath))
{
strError.Format(_T("AppName:%s is not existed. CLogFactory::CreateLogName return FALSE."), strAppPath);
LOGGER_WRITE(strError.GetBuffer());
LogEvent(strError);
return FALSE;
}
strError.Format(_T("AppName:%s"), strAppPath);
LOGGER_WRITE(strError.GetBuffer());
int iIndex = strAppPath.ReverseFind(_T('\\'));
ATLASSERT(-1 != iIndex);
strAppPath = strAppPath.Left(iIndex + 1);
CParameter Parameter;
CConfigReader Reader;
Reader.Read(strAppPath, strFileName, strSection, FileType, Parameter);
CHAR Buffer[MAX_PATH] = { 0 };
#pragma warning(push)
#pragma warning(disable: 4996)
strcat(Buffer, Parameter.m_cFixFolder);
strcat(Buffer, Parameter.m_cCycleFolder);
strcat(Buffer, Parameter.m_cCycleName);
strcat(Buffer, Parameter.m_cCreateTime);
strcat(Buffer, Parameter.m_cSaveTime);
strcat(Buffer, Parameter.m_cExeName);
#pragma warning(pop)
strLogName = CString(Buffer);
strLogName.Remove(_T('\\'));
strLogName.Remove(_T(':'));
strLogName.Remove(_T('.'));
strLogName.Remove(_T(' '));
LOGGER_WRITE2(_T("LogName:") << strLogName.GetBuffer() << _T(" FileType:") << FileType);
return TRUE;
}
示例7: ReadFrom
void CAutoRegisterConfig::ReadFrom()
{
CString iniFile = theApp.GetWorkPath();
iniFile.Append(_T("\\IBAConfig\\register.ini"));
{
CString str;
::GetPrivateProfileString(_T("Base"), _T("Amount24"), _T(""), str.GetBuffer(200), 200, iniFile);
str.ReleaseBuffer();
Set24Amount(str);
}
{
m_arrayRandomAmount.clear();
CString str;
::GetPrivateProfileString(_T("Base"), _T("RandomAmount"), _T("5,10,20"), str.GetBuffer(200), 200, iniFile);
str.ReleaseBuffer();
CStringArray strArray;
CIBAHelpper::SplitLine(str, strArray, _T(','));
for (int i = 0; i < strArray.GetCount(); i++)
{
m_arrayRandomAmount.push_back(_ttoi(strArray.GetAt(i)));
}
}
{
CString str;
::GetPrivateProfileString(_T("Base"), _T("StartTime"), _T(""), str.GetBuffer(200), 200, iniFile);
str.ReleaseBuffer();
str.Remove(_T(' '));
str.Remove(_T('-'));
str.Remove(_T(':'));
m_startTime = CIBAHelpper::CenterTimeToOleDateTime(str);
}
{
CString str;
::GetPrivateProfileString(_T("Base"), _T("EndTime"), _T(""), str.GetBuffer(200), 200, iniFile);
str.ReleaseBuffer();
str.Remove(_T(' '));
str.Remove(_T('-'));
str.Remove(_T(':'));
m_endTime = CIBAHelpper::CenterTimeToOleDateTime(str);
}
{
CString str;
::GetPrivateProfileString(_T("Base"), _T("IDFile"), _T(""), str.GetBuffer(200), 200, iniFile);
str.ReleaseBuffer();
m_strFilePath = str;
}
}
示例8: Modify
BOOL CCtrlInfo::Modify(const CWnd* pCtrl, const CWnd* pParent,
LPCTSTR lpszString, char chSpr /*= '+'*/)
{
ASSERT(::IsWindow(pCtrl->m_hWnd));
ASSERT(::IsWindow(pParent->m_hWnd));
ASSERT(::IsChild(pParent->m_hWnd, pCtrl->m_hWnd));
pCtrl->GetWindowRect(&m_rcInit);
pParent->ScreenToClient(&m_rcInit);
// XR: Get position information from Initialization string
CString str = lpszString;
str.Remove(' ');
str.MakeUpper();
int nLen = str.GetLength();
int posSpr = -1;
int posSprNext = 0;
while(posSprNext != -1)
{
CString strSection;
posSprNext = str.Find(chSpr, posSpr + 1); // XR: default separator between sections is '+'
if (posSprNext == -1)
strSection = str.Mid(posSpr + 1, nLen - posSpr - 1);
else
strSection = str.Mid(posSpr + 1, posSprNext - posSpr - 1);
if (!this->ExtractOptions(strSection, pCtrl, pParent))
return FALSE;
posSpr = posSprNext;
}
return TRUE;
}
示例9: GetIDString
CString CNBUnitDevice::GetIDString(TCHAR HiddenChar)
{
CString strText;
if (m_pDevice) {
CString strID = m_pDevice->m_BaseInfo.szDeviceStringId;
strID.Remove(_T('-'));
strText +=
strID.Mid(0, 5) + _T("-") +
strID.Mid(5, 5) + _T("-") +
strID.Mid(10, 5) + _T("-");
strText += HiddenChar;
strText += HiddenChar;
strText += HiddenChar;
strText += HiddenChar;
strText += HiddenChar;
// strID.Mid(0, 5) + _T("-") +
} else {
//
// to do: create ID from device ID.(But we don't have corresponding NDAS device object!!)
//
strText += "";
}
return strText;
}
示例10: ExistsSourceView
BOOL CBonfireDoc::ExistsSourceView(LPCTSTR lpszPathName)
{
CStringList pTabList;
CString ext = (lpszPathName == NULL)
? GetFileExtension(GetPathName())
: GetFileExtension(lpszPathName);
// generate tabs based on the file extension
CString strViews = theApp.m_opOptions.views.vAssociations[0].strViews; // init to default views
CString strExtList = "";
size_t nExt = theApp.m_opOptions.views.vAssociations.size();
// see if the current file's extension is in the list
while (nExt-- > 0) // 0 is the default file extension
{
strExtList = (CString)theApp.m_opOptions.views.vAssociations[nExt].strExtensions;
strExtList.Remove(' ');
if (IsStringPresent(strExtList, ext))
{
strViews = theApp.m_opOptions.views.vAssociations[nExt].strViews;
break;
}
}
return (strViews[0] != '-' || strViews[0] == 's');
}
示例11: initialEval
CString CUDSMainWnd::initialEval(CString Data2Send )
{
int CService;
CService = strtol(CurrentService, NULL, 16);
if ( CService==0x10 || CService==0x11 ||CService==0x28 ||CService==0x31 ||CService==0x3E ||CService==0x85 ||CService==0xA0)
{
CString SendingData = Data2Send;
//SendingData.Replace(" ",""); //added by Alejandra - not working
SendingData.Remove(' '); // added in adition to previos function not working
SendingData = Data2Send.Right(Data2Send.GetLength() - NO_OF_CHAR_IN_BYTE);
int pos;
pos = SendingData.Find('8', 0);
//CString SecondByte = SendingData.Left(1); //added by Alejandra - not working
if(pos == 1) //initial if(SecondByte == '8')
{
Font_Color = RGB(0,255,0 );
return " No Response Required";
}
}
Font_Color = RGB(184,134,11 );
return " No Response Received"; // If it's the case of No Positive Response Required return the default value
}
示例12: Validate
bool CFloatEdit::Validate() {
CString text;
this->GetWindowTextA(text);
text.Trim();
// empty string
if(text.IsEmpty()) {
return false;
}
// there is at least one number
if(text.FindOneOf("0123456789") == -1) {
return false;
}
// character besides digits or period?
if(text.SpanIncluding("0123456789.-") != text) {
return false;
}
// minus sign is not only in the first spot. implies only one minus sign
if(text.ReverseFind('-') > 0) {
return false;
}
// more than one period?
if(text.Remove('.') > 1) {
return false;
}
return true;
}
示例13: WriteTag
//***************************************************************************************
BOOL CBCGPXMLSettings::WriteTag (LPCTSTR pszKey, LPCTSTR lpszBuffer)
{
ASSERT (pszKey != NULL);
ASSERT (lpszBuffer != NULL);
if (m_bReadOnly)
{
ASSERT (FALSE);
return FALSE;
}
if (m_pCurrNode == NULL)
{
ASSERT (FALSE);
return FALSE;
}
ASSERT_VALID (m_pCurrNode);
CString strKey = pszKey;
strKey.Remove (_T(' '));
CBCGPXMLNode* pNode = m_pCurrNode->FindChild (strKey);
if (pNode == NULL)
{
pNode = new CBCGPXMLNode;
pNode->m_strName = strKey;
m_pCurrNode->AddChild (pNode);
}
pNode->m_strValue = lpszBuffer;
return TRUE;
}
示例14: dlg
BOOL CCoolFormat3Doc::DoSave( LPCTSTR lpszPathName, BOOL bReplace /*= TRUE*/ )
{
if ( lpszPathName == NULL )
{
TCHAR szPath[MAX_PATH];
CString strDefault = GetTitle();
strDefault.Remove('*');
strDefault = strDefault.Trim();
CString strFilter = _T("All Files(*.*)|*.*|")
_T("C/C++ Files(*.c;*.cpp;*.h;*.hpp)|*.c;*.cpp;*.h;*.hpp|")
_T("C# Files(*.cs)|*.cs|")
_T("Java Files(*.java)|*.java||");
g_GlobalUtils.m_sLanguageExt.GetAllLanguageFilter(strFilter);
DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT|OFN_EXTENSIONDIFFERENT;
CFileDialog dlg(FALSE, NULL, strDefault, dwFlags, strFilter, NULL);
if ( dlg.DoModal() == IDOK )
{
CString strTemp = dlg.GetPathName();
if (dlg.m_ofn.nFilterIndex < MAX_SYN_LANG + 1 && dlg.m_ofn.nFilterIndex > 1)
{
CString strExt;
g_GlobalUtils.m_sLanguageExt.GetLanguageOneFilter(dlg.m_ofn.nFilterIndex - 2, strExt);
strTemp.Append(strExt);
}
lstrcpy(szPath, strTemp.GetBuffer(0));
lpszPathName = szPath;
}
else
return FALSE;
}
return CDocument::DoSave(lpszPathName, bReplace);
}
示例15: OnInitDialog
BOOL CMediaSettingsPage::OnInitDialog()
{
CSettingsPage::OnInitDialog();
m_bEnablePlay = Settings.MediaPlayer.EnablePlay;
m_bEnableEnqueue = Settings.MediaPlayer.EnableEnqueue;
for ( string_set::const_iterator i = Settings.MediaPlayer.FileTypes.begin() ;
i != Settings.MediaPlayer.FileTypes.end(); ++i )
{
m_wndList.AddString( *i );
}
m_wndServices.AddString( _T("(") + LoadString( IDS_GENERAL_CUSTOM ) + _T("\x2026)") );
m_wndServices.AddString( LoadString( IDS_MEDIA_SMPLAYER ) );
int nSelected = nSnareazaIndex;
for ( string_set::const_iterator i = Settings.MediaPlayer.ServicePath.begin() ;
i != Settings.MediaPlayer.ServicePath.end(); ++i )
{
CString sPlayer = *i;
int nAstrix = sPlayer.ReverseFind( _T('*') );
sPlayer.Remove( _T('*') );
int nIndex = m_wndServices.AddString( PathFindFileName( sPlayer ) );
if ( nAstrix != -1 ) // Selected player
nSelected = nIndex;
m_wndServices.SetItemDataPtr( nIndex, new CString( sPlayer ) );
}
m_wndServices.SetCurSel( nSelected );
UpdateData( FALSE );
Update();
return TRUE;
}