qtcsv/sources/reader.cpp
bool Reader::readToData(const QString& filePath,
                        AbstractData& data,
                        const QString& separator,
                        const QString& textDelimiter,
                        QTextCodec* codec)
{
    QList<QStringList> list;
    if (false == ReaderPrivate::read(filePath, list, separator, textDelimiter,
                                     codec))
    {
        return false;
    }

    for (int i = 0; i < list.size(); ++i)
    {
        data.addRow( list.at(i) );
    }

    return true;
}
// Read csv-file and save it's data to AbstractData-based container class
// @input:
// - filePath - string with absolute path to csv-file
// - data - AbstractData object where all file content will be saved
// - separator - string or character that separate elements in a row
// - textDelimiter - string or character that enclose each element in a row
// - codec - pointer to codec object that would be used for file reading
// @output:
// - bool - True if file was successfully read, otherwise False
Read csv-file and save it's data to AbstractData-based container class
Read csv - file and save it ' s data to AbstractData - based container class
bool Reader::readToData(const QString& filePath,
                        AbstractData& data,
                        const QString& separator,
                        const QString& textDelimiter,
                        QTextCodec* codec)
{
    QList<QStringList> list;
    if (false == ReaderPrivate::read(filePath, list, separator, textDelimiter,
                                     codec))
    {
        return false;
    }
    for (int i = 0; i < list.size(); ++i)
    {
        data.addRow( list.at(i) );
    }
    return true;
}
bool Reader :: readToData ( const QString & filePath , AbstractData & data , const QString & separator , const QString & textDelimiter , QTextCodec * codec ) { QList < QStringList > list ; if ( false == ReaderPrivate :: read ( filePath , list , separator , textDelimiter , codec ) ) { return false ; } for ( int i = 0 ; i < list . size ( ) ; ++ i ) { data . addRow ( list . at ( i ) ) ; } return true ; }
Read csv-file and save it's data to AbstractData-based container class
Read csv - file and save it ' s data to AbstractData - based container class