bool COptionsDlgSelector::ValidateFilesSelected() { bool bValid = false; CStdString sDocOne; m_cboDocumentOne.GetWindowText( sDocOne.GetBuffer(MAX_PATH*2), MAX_PATH*2 ); sDocOne.ReleaseBuffer(); for( int nModifiedDocumentIndex = 0; nModifiedDocumentIndex < MultipleModifiedSelector::CountOfSelectors(); nModifiedDocumentIndex++ ) { CStdString sDocTwo( m_multiModifiedDlg.GetModifiedText( nModifiedDocumentIndex ) ); if( ValidateFiles( sDocOne, nModifiedDocumentIndex, sDocTwo ) ) bValid = true; } return bValid; }
// converts the input opCPP format to c++ format bool opDriver::Convert(const opParameters& p) { opMemoryTracker memorytracker; bool bResult = true; // run it try { // Validate the files specified on the command // line (oh and doh). if (!ValidateDialectFiles(p) || !ValidateFiles(p)) { return false; } if (p.CleanMode) { bResult = CleanMode(p) ? bResult : false; return bResult; } if (!bResult) return false; bool bSkipCompiling = false; // must be in normal mode to read dialects if (p.NormalMode) { // check dependencies bool bNewDependency = CheckDependencies(); if (bNewDependency) { if (p.Verbose) { Log("Dependency is out of date, forcing recompile ..."); Log(""); } ForceCompile(); } // if new dependency, we can't try to skip if (!bNewDependency && !p.Force) { // early skip detection: // if we have any dialect files out of date, we must continue if (DialectsCurrent()) { // if we have any code files out of date, we must continue if (CodeCurrent()) { // or else, we can just get out of here... bSkipCompiling = true; } } } if (!bSkipCompiling) bResult = DialectMode(p) ? bResult : false; } if (!bSkipCompiling) { if (!bResult) return false; // validate dialect read parameters if (!opParameters::ValidateParameters()) return false; // validate registered dialects if (!DialectTracker::Validate()) { opError::Print(); return false; } if (p.NormalMode) bResult = NormalMode(p) ? bResult : false; if (!bResult) return false; } // glob mode if (p.GlobMode) bResult = GlobMode(p) ? bResult : false; if (!bResult) return false; return true; } catch (opException::opCPP_Exception&) { opError::ExceptionError("opCPP"); } catch (opException::opCPP_ParseException&) { opError::ExceptionError("opCPP Parse"); } catch (opException::opCPP_FatalException&) { opError::ExceptionError("opCPP Fatal"); } catch (opException::opCPP_AssertException& e) { opError::ExceptionError("Assert Failed (" + e.exceptionstring + ")"); } catch (boost::filesystem::filesystem_error& fe) { opString errorstr = fe.what(); opString who = ""; errorstr.Replace(who, "Error: Improper path detected "); Log(errorstr); Log(opParameters::Get().GetCommandLineString()); } catch (...) { opError::ExceptionError("Unhandled Unknown"); } opException::CaughtException(); return false; }