BinClone/CloneSearcherLib/CSController.cpp
//
// Parse the assembly files in assemblyFolderPath and
// convert them, and store them into the database.
//
Parse the assembly files in assemblyFolderPath and
convert them, and store them into the database.
Parse the assembly files in assemblyFolderPath and convert them and store them into the database .
bool CCSController::populateAssemblyToDB(LPCTSTR assemblyFolderPath,
                                         TCSRegNormalizeLevel regNormLevel,                                      
                                         int windowSize,
                                         int stride                                 
                                         )
{
    if (!m_assemblyFileMgr.constructBasicFeatures())
        return false;
    CCSParam param(regNormLevel, windowSize, stride);
    if (!m_dbMgr.storeParam(param))
        return false;
    long startProgTime = getTime();
    if (!m_assemblyFileMgr.parseFolder(assemblyFolderPath, param, true )) { 
        tcout << _T("Error: failed to parse folder: ") << assemblyFolderPath << endl;
        return false;
    }
    if (!m_assemblyFileMgr.parseFolder(assemblyFolderPath, param, false)) {  
        tcout << _T("Error: failed to parse folder: ") << assemblyFolderPath << endl;
        return false;
    }
    long endProgTime = getTime();
    tcout << _T("Spent: ") << endProgTime - startProgTime << _T("s in total to populate the assembly files to the database.") << std::endl; 
    return true;
}
bool CCSController :: populateAssemblyToDB ( LPCTSTR assemblyFolderPath , TCSRegNormalizeLevel regNormLevel , int windowSize , int stride ) { if ( ! m_assemblyFileMgr . constructBasicFeatures ( ) ) return false ; CCSParam param ( regNormLevel , windowSize , stride ) ; if ( ! m_dbMgr . storeParam ( param ) ) return false ; long startProgTime = getTime ( ) ; if ( ! m_assemblyFileMgr . parseFolder ( assemblyFolderPath , param , true ) ) { tcout << _T ( " " ) << assemblyFolderPath << endl ; return false ; } if ( ! m_assemblyFileMgr . parseFolder ( assemblyFolderPath , param , false ) ) { tcout << _T ( " " ) << assemblyFolderPath << endl ; return false ; } long endProgTime = getTime ( ) ; tcout << _T ( " " ) << endProgTime - startProgTime << _T ( " " ) << std :: endl ; return true ; }
Parse the assembly files in assemblyFolderPath and
convert them, and store them into the database.
Parse the assembly files in assemblyFolderPath and convert them and store them into the database .
// construct a list of feature strings. // Store parameters to database // Read the assembly files from the given folder path. // The first call is to construct the global features. // The second call is to do the actual feature countings. // first scan of the files to calculate the final median vector // Second Scan of the files to find clones