bool CTSVNPathList::WriteToFile(const CString& sFilename, bool bANSI /* = false */) const { try { if (bANSI) { CStdioFile file(sFilename, CFile::typeText | CFile::modeReadWrite | CFile::modeCreate); PathVector::const_iterator it; for(it = m_paths.begin(); it != m_paths.end(); ++it) { CStringA line = CStringA(it->GetSVNPathString()) + '\n'; file.Write(line, line.GetLength()); } file.Close(); } else { CStdioFile file(sFilename, CFile::typeBinary | CFile::modeReadWrite | CFile::modeCreate); PathVector::const_iterator it; for(it = m_paths.begin(); it != m_paths.end(); ++it) { file.WriteString(it->GetSVNPathString()+L"\n"); } file.Close(); } } catch (CFileException* pE) { CTraceToOutputDebugString::Instance()(__FUNCTION__ ": CFileException in writing temp file\n"); pE->Delete(); return false; } return true; }
CString CTSVNPathList::CreateAsteriskSeparatedString() const { CString sRet; PathVector::const_iterator it; for(it = m_paths.begin(); it != m_paths.end(); ++it) { if (!sRet.IsEmpty()) sRet += L"*"; sRet += it->IsUrl() ? it->GetSVNPathString() : it->GetWinPathString(); } return sRet; }