10 #include "linkablemapobj.h"
13 static BranchObj *lastBranch;
14 static FloatObj *lastFloat;
15 static OrnamentedObj *lastOO;
17 extern Settings settings;
18 extern QString vymVersion;
21 parseBaseHandler::parseBaseHandler() {}
23 parseBaseHandler::~parseBaseHandler() {}
25 QString parseBaseHandler::errorProtocol() { return errorProt; }
29 bool parseBaseHandler::startDocument()
33 laststate = StateInit;
35 stateStack.append(StateInit);
43 QString parseBaseHandler::parseHREF(QString href)
45 QString type=href.section(":",0,0);
46 QString path=href.section(":",1,1);
47 if (!tmpDir.endsWith("/"))
48 return tmpDir + "/" + path;
55 QString parseBaseHandler::errorString()
57 return "the document is not in the VYM file format";
61 bool parseBaseHandler::fatalError( const QXmlParseException& exception )
63 errorProt += QString( "Fatal parsing error: %1 in line %2, column %3\n")
64 .arg( exception.message() )
65 .arg( exception.lineNumber() )
66 .arg( exception.columnNumber() );
67 // Try to read the bogus line
68 errorProt+=QString("File is: %1\n").arg(inputFile);
70 if (loadStringFromDisk (inputFile,s))
72 QStringList sl=QStringList::split ("\n",s);
74 QStringList::Iterator it = sl.begin();
75 while (i<exception.lineNumber())
81 s.insert (exception.columnNumber()-1,"<ERROR>");
84 return QXmlDefaultHandler::fatalError( exception );
87 void parseBaseHandler::setModel (VymModel *m)
92 void parseBaseHandler::setTmpDir (QString tp)
97 void parseBaseHandler::setInputFile (QString f)
102 void parseBaseHandler::setLoadMode (const LoadMode &lm)