📄 qxml-h.html
字号:
QXmlContentHandler* contentHandler() const; void setErrorHandler( QXmlErrorHandler* handler ); QXmlErrorHandler* errorHandler() const; void setLexicalHandler( QXmlLexicalHandler* handler ); QXmlLexicalHandler* lexicalHandler() const; void setDeclHandler( QXmlDeclHandler* handler ); QXmlDeclHandler* declHandler() const; bool parse( const QXmlInputSource& input ); bool parse( const QXmlInputSource* input ); virtual bool parse( const QXmlInputSource* input, bool incremental ); virtual bool parseContinue();private: // variables QXmlContentHandler *contentHnd; QXmlErrorHandler *errorHnd; QXmlDTDHandler *dtdHnd; QXmlEntityResolver *entityRes; QXmlLexicalHandler *lexicalHnd; QXmlDeclHandler *declHnd; QXmlInputSource *inputSource; QChar c; // the character at reading position int lineNr; // number of line int columnNr; // position in line int namePos; QChar nameArray[256]; // only used for names QString nameValue; // only used for names int refPos; QChar refArray[256]; // only used for references QString refValue; // only used for references int stringPos; QChar stringArray[256]; // used for any other strings that are parsed QString stringValue; // used for any other strings that are parsed QXmlSimpleReaderPrivate* d; // inlines bool is_S( const QChar& ); bool is_NameBeginning( const QChar& ); bool is_NameChar( const QChar& ); QString& string(); void stringClear(); void stringAddC(); void stringAddC(const QChar&); QString& name(); void nameClear(); void nameAddC(); void nameAddC(const QChar&); QString& ref(); void refClear(); void refAddC(); void refAddC(const QChar&); // used by parseReference() and parsePEReference() enum EntityRecognitionContext { InContent, InAttributeValue, InEntityValue, InDTD }; // private functions bool eat_ws(); bool next_eat_ws(); void next(); bool atEnd(); void init( const QXmlInputSource* i ); void initData(); bool entityExist( const QString& ) const; bool parseBeginOrContinue( int state, bool incremental ); bool parseProlog(); bool parseElement(); bool processElementEmptyTag(); bool processElementETagBegin2(); bool processElementAttribute(); bool parseMisc(); bool parseContent(); bool parsePI(); bool parseDoctype(); bool parseComment(); bool parseName(); bool parseNmtoken(); bool parseAttribute(); bool parseReference(); bool processReference(); bool parseExternalID(); bool parsePEReference(); bool parseMarkupdecl(); bool parseAttlistDecl(); bool parseAttType(); bool parseAttValue(); bool parseElementDecl(); bool parseNotationDecl(); bool parseChoiceSeq(); bool parseEntityDecl(); bool parseEntityValue(); bool parseString(); bool insertXmlRef( const QString&, const QString&, bool ); bool reportEndEntities(); void reportParseError( const QString& error ); typedef bool (QXmlSimpleReader::*ParseFunction) (); void unexpectedEof( ParseFunction where, int state ); void parseFailed( ParseFunction where, int state ); void pushParseState( ParseFunction function, int state ); friend class QXmlSimpleReaderPrivate; friend class QXmlSimpleReaderLocator;};//// SAX Locator//class QM_EXPORT_XML QXmlLocator{public: QXmlLocator(); virtual ~QXmlLocator(); virtual int columnNumber() = 0; virtual int lineNumber() = 0;// QString getPublicId()// QString getSystemId()};//// SAX handler classes//class QM_EXPORT_XML QXmlContentHandler{public: virtual void setDocumentLocator( QXmlLocator* locator ) = 0; virtual bool startDocument() = 0; virtual bool endDocument() = 0; virtual bool startPrefixMapping( const QString& prefix, const QString& uri ) = 0; virtual bool endPrefixMapping( const QString& prefix ) = 0; virtual bool startElement( const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts ) = 0; virtual bool endElement( const QString& namespaceURI, const QString& localName, const QString& qName ) = 0; virtual bool characters( const QString& ch ) = 0; virtual bool ignorableWhitespace( const QString& ch ) = 0; virtual bool processingInstruction( const QString& target, const QString& data ) = 0; virtual bool skippedEntity( const QString& name ) = 0; virtual QString errorString() = 0;};class QM_EXPORT_XML QXmlErrorHandler{public: virtual bool warning( const QXmlParseException& exception ) = 0; virtual bool error( const QXmlParseException& exception ) = 0; virtual bool fatalError( const QXmlParseException& exception ) = 0; virtual QString errorString() = 0;};class QM_EXPORT_XML QXmlDTDHandler{public: virtual bool notationDecl( const QString& name, const QString& publicId, const QString& systemId ) = 0; virtual bool unparsedEntityDecl( const QString& name, const QString& publicId, const QString& systemId, const QString& notationName ) = 0; virtual QString errorString() = 0;};class QM_EXPORT_XML QXmlEntityResolver{public: virtual bool resolveEntity( const QString& publicId, const QString& systemId, QXmlInputSource*& ret ) = 0; virtual QString errorString() = 0;};class QM_EXPORT_XML QXmlLexicalHandler{public: virtual bool startDTD( const QString& name, const QString& publicId, const QString& systemId ) = 0; virtual bool endDTD() = 0; virtual bool startEntity( const QString& name ) = 0; virtual bool endEntity( const QString& name ) = 0; virtual bool startCDATA() = 0; virtual bool endCDATA() = 0; virtual bool comment( const QString& ch ) = 0; virtual QString errorString() = 0;};class QM_EXPORT_XML QXmlDeclHandler{public: virtual bool attributeDecl( const QString& eName, const QString& aName, const QString& type, const QString& valueDefault, const QString& value ) = 0; virtual bool internalEntityDecl( const QString& name, const QString& value ) = 0; virtual bool externalEntityDecl( const QString& name, const QString& publicId, const QString& systemId ) = 0; virtual QString errorString() = 0;};class QM_EXPORT_XML QXmlDefaultHandler : public QXmlContentHandler, public QXmlErrorHandler, public QXmlDTDHandler, public QXmlEntityResolver, public QXmlLexicalHandler, public QXmlDeclHandler{public: QXmlDefaultHandler() { } virtual ~QXmlDefaultHandler() { } void setDocumentLocator( QXmlLocator* locator ); bool startDocument(); bool endDocument(); bool startPrefixMapping( const QString& prefix, const QString& uri ); bool endPrefixMapping( const QString& prefix ); bool startElement( const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts ); bool endElement( const QString& namespaceURI, const QString& localName, const QString& qName ); bool characters( const QString& ch ); bool ignorableWhitespace( const QString& ch ); bool processingInstruction( const QString& target, const QString& data ); bool skippedEntity( const QString& name ); bool warning( const QXmlParseException& exception ); bool error( const QXmlParseException& exception ); bool fatalError( const QXmlParseException& exception ); bool notationDecl( const QString& name, const QString& publicId, const QString& systemId ); bool unparsedEntityDecl( const QString& name, const QString& publicId, const QString& systemId, const QString& notationName ); bool resolveEntity( const QString& publicId, const QString& systemId, QXmlInputSource*& ret ); bool startDTD( const QString& name, const QString& publicId, const QString& systemId ); bool endDTD(); bool startEntity( const QString& name ); bool endEntity( const QString& name ); bool startCDATA(); bool endCDATA(); bool comment( const QString& ch ); bool attributeDecl( const QString& eName, const QString& aName, const QString& type, const QString& valueDefault, const QString& value ); bool internalEntityDecl( const QString& name, const QString& value ); bool externalEntityDecl( const QString& name, const QString& publicId, const QString& systemId ); QString errorString();private: QXmlDefaultHandlerPrivate *d;};//// inlines//inline bool QXmlSimpleReader::is_S(const QChar& ch){ return ch==' ' || ch=='\t' || ch=='\n' || ch=='\r';}inline bool QXmlSimpleReader::is_NameBeginning( const QChar& ch ){ return ch=='_' || ch==':' || ch.isLetter() || // ### Category Lm is not allowed ch.category()==QChar::Number_Letter;}inline bool QXmlSimpleReader::is_NameChar( const QChar& ch ){ return ch=='.' || ch=='-' || ch=='_' || ch==':' || ch.isLetterOrNumber() || // ### Category No is not allowed ch.isMark();}inline bool QXmlSimpleReader::atEnd(){ return (c.unicode()|0x0001) == 0xffff; }inline void QXmlSimpleReader::stringClear(){ stringValue = ""; stringPos = 0; }inline void QXmlSimpleReader::nameClear(){ nameValue = ""; namePos = 0; }inline void QXmlSimpleReader::refClear(){ refValue = ""; refPos = 0; }inline int QXmlAttributes::count() const{ return length(); }#endif //QT_NO_XML#endif</pre><!-- eof --><p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright © 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -