qtcsv/sources/reader.cpp
bool ReaderPrivate::checkParams(const QString& filePath,
                                const QString& separator)
{
    if ( separator.isEmpty() )
    {
        qDebug() << __FUNCTION__ << "Error - separator could not be empty";
        return false;
    }

    if ( filePath.isEmpty() )
    {
        qDebug() << __FUNCTION__ << "Error - file path is empty";
        return false;
    }

    if ( false == CheckFile(filePath, true) )
    {
        qDebug() << __FUNCTION__ << "Error - wrong file path:" << filePath;
        return false;
    }

    return true;
}
// Check if file path and separator are valid
// @input:
// - filePath - string with absolute path to csv-file
// - separator - string or character that separate values in a row
// @output:
// - bool - True if file path and separator are valid, otherwise False
Check if file path and separator are valid
Check if file path and separator are valid
bool ReaderPrivate::checkParams(const QString& filePath,
                                const QString& separator)
{
    if ( separator.isEmpty() )
    {
        qDebug() << __FUNCTION__ << "Error - separator could not be empty";
        return false;
    }
    if ( filePath.isEmpty() )
    {
        qDebug() << __FUNCTION__ << "Error - file path is empty";
        return false;
    }
    if ( false == CheckFile(filePath, true) )
    {
        qDebug() << __FUNCTION__ << "Error - wrong file path:" << filePath;
        return false;
    }
    return true;
}
bool ReaderPrivate :: checkParams ( const QString & filePath , const QString & separator ) { if ( separator . isEmpty ( ) ) { qDebug ( ) << __FUNCTION__ << " " ; return false ; } if ( filePath . isEmpty ( ) ) { qDebug ( ) << __FUNCTION__ << " " ; return false ; } if ( false == CheckFile ( filePath , true ) ) { qDebug ( ) << __FUNCTION__ << " " << filePath ; return false ; } return true ; }
Check if file path and separator are valid
Check if file path and separator are valid