2
// C++ Implementation: parser
4
// Description: superclass for external formats parsers
7
// Author: Ingo Kossyk <kossyki@cs.tu-berlin.de>, (C) 2004
9
// Copyright: See COPYING file that comes with this distribution
17
@author Ingo Kossyk (kossyki@cs.tu-berlin.de)
21
Parser::Parser() : QObject()
31
void Parser::clearLocations()
33
while(!m_sLocations.isEmpty())
34
m_sLocations.removeFirst();
37
long Parser::countParsed()
39
return (long)m_sLocations.count();
42
bool Parser::isFilepath(QString sFilepath){
43
QFile file(sFilepath);
44
bool exists = file.exists();
49
bool Parser::isBinary(QString filename){
52
if(file.open(QIODevice::ReadOnly)){
58
qDebug() << "Parser: Error reading stream on " << filename;
59
return true; //should this raise an exception?
64
if(!(33<=uc && uc<=127)) //Starting byte is no character
71
qDebug() << "Parser: Could not open file: " << filename;
73
//qDebug(QString("Parser: textstream starting character is: %1").arg(i));