BinClone/CloneSearcherLib/CSAssemblyFileMgr.cpp
//
// Open the raw assembly file.
// Return false if error.
//
Open the raw assembly file.
Return false if error.
Open the raw assembly file . Return false if error .
bool CCSAssemblyFileMgr::openRawAssemblyFile(LPCTSTR assemblyFilePath)
{
    if (m_pRawAssemblyFile) {
        tcout << _T("Error: CCSAssemblyFileMgr: only one raw file can be opened at a time: ") << assemblyFilePath << endl;
        ASSERT(false);
        return false;
    }
    m_pRawAssemblyFile = new CStdioFile();
    try {        
        if (!m_pRawAssemblyFile->Open(assemblyFilePath, CFile::modeRead)) {
            tcout << _T("CCSAssemblyFileMgr: failed to open file: ") << assemblyFilePath << endl;
            delete m_pRawAssemblyFile;
            m_pRawAssemblyFile = NULL;
            ASSERT(false);
            return false;
        }
        return true;
    }
    catch (CFileException&) {
        tcout << _T("CCSAssemblyFileMgr: failed to read assembly file: ") << assemblyFilePath << endl;
        delete m_pRawAssemblyFile;
        m_pRawAssemblyFile = NULL;
        ASSERT(false);
        return false;
    }
}
bool CCSAssemblyFileMgr :: openRawAssemblyFile ( LPCTSTR assemblyFilePath ) { if ( m_pRawAssemblyFile ) { tcout << _T ( " " ) << assemblyFilePath << endl ; ASSERT ( false ) ; return false ; } m_pRawAssemblyFile = new CStdioFile ( ) ; try { if ( ! m_pRawAssemblyFile -> Open ( assemblyFilePath , CFile :: modeRead ) ) { tcout << _T ( " " ) << assemblyFilePath << endl ; delete m_pRawAssemblyFile ; m_pRawAssemblyFile = NULL ; ASSERT ( false ) ; return false ; } return true ; } catch ( CFileException & ) { tcout << _T ( " " ) << assemblyFilePath << endl ; delete m_pRawAssemblyFile ; m_pRawAssemblyFile = NULL ; ASSERT ( false ) ; return false ; } }
Open the raw assembly file.
Open the raw assembly file .