10 #include "linkablemapobj.h"
14 static BranchObj *lastBranch;
15 static FloatObj *lastFloat;
16 static OrnamentedObj *lastOO;
18 extern Settings settings;
19 extern QString vymVersion;
22 parseBaseHandler::parseBaseHandler() {}
24 parseBaseHandler::~parseBaseHandler() {}
26 QString parseBaseHandler::errorProtocol() { return errorProt; }
30 bool parseBaseHandler::startDocument()
34 laststate = StateInit;
36 stateStack.append(StateInit);
44 QString parseBaseHandler::parseHREF(QString href)
46 QString type=href.section(":",0,0);
47 QString path=href.section(":",1,1);
48 if (!tmpDir.endsWith("/"))
49 return tmpDir + "/" + path;
56 QString parseBaseHandler::errorString()
58 return "the document is not in the VYM file format";
62 bool parseBaseHandler::fatalError( const QXmlParseException& exception )
64 errorProt += QString( "Fatal parsing error: %1 in line %2, column %3\n")
65 .arg( exception.message() )
66 .arg( exception.lineNumber() )
67 .arg( exception.columnNumber() );
68 // Try to read the bogus line
69 errorProt+=QString("File is: %1\n").arg(inputFile);
71 if (loadStringFromDisk (inputFile,s))
73 QStringList sl=QStringList::split ("\n",s);
75 QStringList::Iterator it = sl.begin();
76 while (i<exception.lineNumber()-1)
82 s.insert (exception.columnNumber()-1,"<ERROR>");
85 return QXmlDefaultHandler::fatalError( exception );
88 void parseBaseHandler::setMapEditor (MapEditor* e)
91 mc=me->getMapCenter();
94 void parseBaseHandler::setTmpDir (QString tp)
99 void parseBaseHandler::setInputFile (QString f)
104 void parseBaseHandler::setLoadMode (const LoadMode &lm)