CString WebUpdateOption(CString strInput) { CString strOutput, strItem, strTemp; CStringList strList; POSITION pos1, pos2; WebGetStringList(strInput, 7, strList); strOutput = _T("<OPTION"); #ifndef __GNUC__ for (pos1 = strList.GetHeadPosition(); pos1 != NULL;) #else for (pos1 = strList.begin(); pos1 != strList.end(); ++pos1) #endif { pos2 = pos1; strItem = strList.GetNext(pos1); strTemp = strItem.Left(6); if (!strTemp.CompareNoCase(_T("value="))) { strItem = strItem.Right(strItem.GetLength()-6); strItem = RemoveQuote(strItem); strOutput += _T(" value="); strOutput += strItem; strList.RemoveAt(pos2); } else if (!strItem.CompareNoCase(_T("selected"))) { strList.RemoveAt(pos2); } } #ifndef __GNUC__ for (pos1 = strList.GetHeadPosition(); pos1 != NULL;) #else for (pos1 = strList.begin(); pos1 != strList.end(); ++pos1) #endif { strOutput += _T(' '); strItem = strList.GetNext(pos1); strOutput += strItem; } strOutput += _T('>'); return strOutput; }
int CFuncList::SubtractThisList(CStringList& rList) { POSITION rPos = rList.GetHeadPosition(); while (rPos) { POSITION tPos = rPos; CString tName = rList.GetNext(rPos); POSITION fPos = GetHeadPosition(); while (fPos) { if (tName == GetNext(fPos)) { rList.RemoveAt(tPos); break; } } } return (int)GetCount(); }
void vmsFilesToDelete::Process() { CStringList sl; _App.FilesToDelete (sl); for (int i = sl.GetCount () - 1; i >= 0; i--) { LPCTSTR psz = sl.GetAt (sl.FindIndex (i)); BOOL bOK = TRUE; if (GetFileAttributes (psz) != DWORD (-1)) bOK = DeleteFile (psz); if (bOK) sl.RemoveAt (sl.FindIndex (i)); } _App.FilesToDelete_save (sl); }
CString WebUpdateInput(CString strInput) { CString strOutput, strItem, strTemp; CStringList strList; POSITION pos1, pos2; int iType; WebGetStringList(strInput, 6, strList); strOutput = _T("<INPUT"); iType = ITEM_TYPE_TEXT; #ifndef __GNUC__ for (pos1 = strList.GetHeadPosition(); pos1 != NULL;) #else for (pos1 = strList.begin(); pos1 != strList.end(); ++pos1) #endif { pos2 = pos1; strItem = strList.GetNext(pos1); strTemp = strItem.Left(5); if (!strTemp.CompareNoCase(_T("name="))) { strItem = strItem.Right(strItem.GetLength()-5); strItem = RemoveQuote(strItem); strOutput += _T(" name="); strOutput += strItem; strList.RemoveAt(pos2); } else if (!strTemp.CompareNoCase(_T("type="))) { strTemp = strItem.Right(strItem.GetLength()-5); strTemp = RemoveQuote(strTemp); if (!strTemp.CompareNoCase(_T("checkbox"))) { iType = ITEM_TYPE_CHECKBOX; } else if (!strTemp.CompareNoCase(_T("text"))) { iType = ITEM_TYPE_TEXT; } else if (!strTemp.CompareNoCase(_T("password"))) { iType = ITEM_TYPE_PASSWORD; } else if (!strTemp.CompareNoCase(_T("radio"))) { iType = ITEM_TYPE_RADIO; } else { iType = ITEM_TYPE_UNKNOWN; } } else if (!strItem.CompareNoCase(_T("checked"))) { strList.RemoveAt(pos2); } } #ifndef __GNUC__ for (pos1 = strList.GetHeadPosition(); pos1 != NULL;) #else for (pos1 = strList.begin(); pos1 != strList.end(); ++pos1) #endif { pos2 = pos1; strItem = strList.GetNext(pos1); strTemp = strItem.Left(6); if (!strTemp.CompareNoCase(_T("value="))) { if (iType == ITEM_TYPE_CHECKBOX || iType == ITEM_TYPE_TEXT || iType == ITEM_TYPE_PASSWORD) { strList.RemoveAt(pos2); } else if (iType == ITEM_TYPE_RADIO) { strItem = strItem.Right(strItem.GetLength()-6); strItem = RemoveQuote(strItem); strOutput += _T(" value="); strOutput += strItem; strList.RemoveAt(pos2); } } } #ifndef __GNUC__ for (pos1 = strList.GetHeadPosition(); pos1 != NULL;) #else for (pos1 = strList.begin(); pos1 != strList.end(); ++pos1) #endif { strOutput += _T(' '); strItem = strList.GetNext(pos1); strOutput += strItem; } strOutput += _T('>'); return strOutput; }