69 qDebug() << tsvFile.fileName();
70 QFileInfo tsv_file_info(tsvFile.fileName());
71 if(!tsv_file_info.exists())
73 throw OdsException(QObject::tr(
"TSV file %1 does not exists")
74 .arg(tsv_file_info.absoluteFilePath()));
76 if(!tsv_file_info.isReadable())
78 throw OdsException(QObject::tr(
"TSV file %1 is not readable")
79 .arg(tsv_file_info.absoluteFilePath()));
81 qDebug() << tsv_file_info.absoluteFilePath();
82 m_handler.startSheet(tsv_file_info.baseName());
83 if(!tsvFile.open(QIODevice::ReadOnly | QFile::Text))
85 throw OdsException(QObject::tr(
"Unable to read TSV file %1")
86 .arg(tsv_file_info.absoluteFilePath()));
88 QTextStream textStreamInput(&tsvFile);
89 parse(textStreamInput);
117 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
121 static const int delta[][5] = {
131 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
132 if(textStreamInput.atEnd())
134 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
138 int state = 0, t, previous_state;
144 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
147 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__ <<
" "
149 if(textStreamInput.atEnd())
153 textStreamInput >> ch;
164 previous_state = state;
165 state = delta[state][t];
177 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__
179 if((previous_state == 2) || (previous_state == 3))
197 QObject::tr(
"End-of-file found while inside quotes."));
201 throw OdsException(QObject::tr(
"Text parse error at line %1, column %2:\n"
205 .arg(error.
qwhat()));
208 catch(std::exception &error)
210 throw OdsException(QObject::tr(
"Text parse error at line %1, column %2:\n"
218 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;