xml.cpp
changeset 558 3665eee7a842
parent 529 ce2abdbd0b65
     1.1 --- a/xml.cpp	Mon Jul 23 12:42:01 2007 +0000
     1.2 +++ b/xml.cpp	Mon Jul 23 12:42:02 2007 +0000
     1.3 @@ -17,14 +17,14 @@
     1.4  extern Settings settings;
     1.5  extern QString vymVersion;
     1.6  
     1.7 -mapBuilderHandler::mapBuilderHandler() {}
     1.8 +parseVYMHandler::parseVYMHandler() {}
     1.9  
    1.10 -mapBuilderHandler::~mapBuilderHandler() {}
    1.11 +parseVYMHandler::~parseVYMHandler() {}
    1.12  
    1.13 -QString mapBuilderHandler::errorProtocol() { return errorProt; }
    1.14 +QString parseVYMHandler::errorProtocol() { return errorProt; }
    1.15  
    1.16  
    1.17 -bool mapBuilderHandler::startDocument()
    1.18 +bool parseVYMHandler::startDocument()
    1.19  {
    1.20      errorProt = "";
    1.21      state = StateInit;
    1.22 @@ -38,7 +38,7 @@
    1.23  }
    1.24  
    1.25  
    1.26 -QString mapBuilderHandler::parseHREF(QString href)
    1.27 +QString parseVYMHandler::parseHREF(QString href)
    1.28  {
    1.29  	QString type=href.section(":",0,0);
    1.30  	QString path=href.section(":",1,1);
    1.31 @@ -48,7 +48,7 @@
    1.32  		return tmpDir + path;
    1.33  }
    1.34  
    1.35 -bool mapBuilderHandler::startElement  ( const QString&, const QString&,
    1.36 +bool parseVYMHandler::startElement  ( const QString&, const QString&,
    1.37                      const QString& eName, const QXmlAttributes& atts ) 
    1.38  {
    1.39      QColor col;
    1.40 @@ -272,7 +272,7 @@
    1.41      return true;
    1.42  }
    1.43  
    1.44 -bool mapBuilderHandler::endElement  ( const QString&, const QString&, const QString &eName)
    1.45 +bool parseVYMHandler::endElement  ( const QString&, const QString&, const QString &eName)
    1.46  {
    1.47  	/* Testing
    1.48  	cout << "endElement </" <<eName.ascii()
    1.49 @@ -303,7 +303,7 @@
    1.50  	return true;
    1.51  }
    1.52  
    1.53 -bool mapBuilderHandler::characters   ( const QString& ch)
    1.54 +bool parseVYMHandler::characters   ( const QString& ch)
    1.55  {
    1.56  	//cout << "characters \""<<ch<<"\"  state="<<state <<"  laststate="<<laststate<<endl;
    1.57  
    1.58 @@ -341,12 +341,12 @@
    1.59      return true;
    1.60  }
    1.61  
    1.62 -QString mapBuilderHandler::errorString() 
    1.63 +QString parseVYMHandler::errorString() 
    1.64  {
    1.65      return "the document is not in the VYM file format";
    1.66  }
    1.67  
    1.68 -bool mapBuilderHandler::fatalError( const QXmlParseException& exception ) 
    1.69 +bool parseVYMHandler::fatalError( const QXmlParseException& exception ) 
    1.70  {
    1.71      errorProt += QString( "Fatal parsing error: %1 in line %2, column %3\n")
    1.72      .arg( exception.message() )
    1.73 @@ -372,28 +372,28 @@
    1.74      return QXmlDefaultHandler::fatalError( exception );
    1.75  }
    1.76  
    1.77 -void mapBuilderHandler::setMapEditor (MapEditor* e)
    1.78 +void parseVYMHandler::setMapEditor (MapEditor* e)
    1.79  {
    1.80      me=e;
    1.81  	mc=me->getMapCenter();
    1.82  }
    1.83  
    1.84 -void mapBuilderHandler::setTmpDir (QString tp)
    1.85 +void parseVYMHandler::setTmpDir (QString tp)
    1.86  {
    1.87  	tmpDir=tp;
    1.88  }
    1.89  
    1.90 -void mapBuilderHandler::setInputFile (QString f)
    1.91 +void parseVYMHandler::setInputFile (QString f)
    1.92  {
    1.93  	inputFile=f;
    1.94  }
    1.95  
    1.96 -void mapBuilderHandler::setLoadMode (const LoadMode &lm)
    1.97 +void parseVYMHandler::setLoadMode (const LoadMode &lm)
    1.98  {
    1.99  	loadMode=lm;
   1.100  }
   1.101  
   1.102 -bool mapBuilderHandler::readBranchAttr (const QXmlAttributes& a)
   1.103 +bool parseVYMHandler::readBranchAttr (const QXmlAttributes& a)
   1.104  {
   1.105  	lastOO=lastBranch;
   1.106  	if (!readOOAttr(a)) return false;
   1.107 @@ -420,7 +420,7 @@
   1.108  	return true;	
   1.109  }
   1.110  
   1.111 -bool mapBuilderHandler::readFrameAttr (const QXmlAttributes& a)
   1.112 +bool parseVYMHandler::readFrameAttr (const QXmlAttributes& a)
   1.113  {
   1.114  	bool ok;
   1.115  	int x;
   1.116 @@ -446,7 +446,7 @@
   1.117  	return true;
   1.118  }
   1.119  
   1.120 -bool mapBuilderHandler::readOOAttr (const QXmlAttributes& a)
   1.121 +bool parseVYMHandler::readOOAttr (const QXmlAttributes& a)
   1.122  {
   1.123  	if (lastOO)
   1.124  	{
   1.125 @@ -500,7 +500,7 @@
   1.126  	return true;	
   1.127  }
   1.128  
   1.129 -bool mapBuilderHandler::readNoteAttr (const QXmlAttributes& a)
   1.130 +bool parseVYMHandler::readNoteAttr (const QXmlAttributes& a)
   1.131  {	// only for backward compatibility (<1.4.6). Use htmlnote now.
   1.132  	no.clear();
   1.133  	QString fn;
   1.134 @@ -513,7 +513,7 @@
   1.135  
   1.136  		if ( !file.open( QIODevice::ReadOnly) )
   1.137  		{
   1.138 -			qWarning ("mapBuilderHandler::readNoteAttr:  Couldn't load "+fn);
   1.139 +			qWarning ("parseVYMHandler::readNoteAttr:  Couldn't load "+fn);
   1.140  			return false;
   1.141  		}	
   1.142  		QTextStream stream( &file );
   1.143 @@ -532,7 +532,7 @@
   1.144  	return true;
   1.145  }
   1.146  
   1.147 -bool mapBuilderHandler::readFloatImageAttr (const QXmlAttributes& a)
   1.148 +bool parseVYMHandler::readFloatImageAttr (const QXmlAttributes& a)
   1.149  {
   1.150  	lastOO=lastFloat;
   1.151  	
   1.152 @@ -599,7 +599,7 @@
   1.153  	return true;
   1.154  }
   1.155  
   1.156 -bool mapBuilderHandler::readXLinkAttr (const QXmlAttributes& a)
   1.157 +bool parseVYMHandler::readXLinkAttr (const QXmlAttributes& a)
   1.158  {
   1.159  	QColor col;
   1.160  	bool okx;
   1.161 @@ -659,14 +659,14 @@
   1.162  	return success;
   1.163  }
   1.164  
   1.165 -bool mapBuilderHandler::readHtmlAttr (const QXmlAttributes& a)
   1.166 +bool parseVYMHandler::readHtmlAttr (const QXmlAttributes& a)
   1.167  {
   1.168  	for (int i=1; i<=a.count(); i++)
   1.169  		htmldata+=" "+a.localName(i-1)+"=\""+a.value(i-1)+"\"";
   1.170  	return true;
   1.171  }
   1.172  
   1.173 -bool mapBuilderHandler::readSettingAttr (const QXmlAttributes& a)
   1.174 +bool parseVYMHandler::readSettingAttr (const QXmlAttributes& a)
   1.175  {
   1.176  	if (!a.value( "key").isEmpty() ) 
   1.177  	{