?? xmlvalidator.hpp
字號:
* should just issue errors as usual. */ virtual void validateElement ( const XMLElementDecl* elemDef ) = 0; /** * Retrieve the Grammar used */ virtual Grammar* getGrammar() const =0; /** * Set the Grammar */ virtual void setGrammar(Grammar* aGrammar) =0; //@} // ----------------------------------------------------------------------- // Virtual DTD handler interface. // ----------------------------------------------------------------------- /** @name Virtual DTD handler interface */ //@{ /** * This method allows the scanner to ask the validator if it handles * DTDs or not. */ virtual bool handlesDTD() const = 0; // ----------------------------------------------------------------------- // Virtual Schema handler interface. // ----------------------------------------------------------------------- /** @name Virtual Schema handler interface */ /** * This method allows the scanner to ask the validator if it handles * Schema or not. */ virtual bool handlesSchema() const = 0; //@} // ----------------------------------------------------------------------- // Setter methods // // setScannerInfo() is called by the scanner to tell the validator // about the stuff it needs to have access to. // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** * @param owningScanner This is a pointer to the scanner to which the * validator belongs. The validator will often * need to query state data from the scanner. * * @param readerMgr This is a pointer to the reader manager that is * being used by the scanner. * * @param bufMgr This is the buffer manager of the scanner. This * is provided as a convenience so that the validator * doesn't have to create its own buffer manager * during the parse process. */ void setScannerInfo ( XMLScanner* const owningScanner , ReaderMgr* const readerMgr , XMLBufferMgr* const bufMgr ); /** * This method is called to set an error reporter on the validator via * which it will report any errors it sees during parsing or validation. * This is generally called by the owning scanner. * * @param errorReporter A pointer to the error reporter to use. This * is not adopted, just referenced so the caller * remains responsible for its cleanup, if any. */ void setErrorReporter ( XMLErrorReporter* const errorReporter ); //@} // ----------------------------------------------------------------------- // Error emitter methods // ----------------------------------------------------------------------- /** @name Error emittor methods */ //@{ /** * This call is a convenience by which validators can emit errors. Most * of the grunt work of loading the text, getting the current source * location, ect... is handled here. * * If the loaded text has replacement parameters, then text strings can be * passed. These will be used to replace the tokens {0}, {1}, {2}, and {3} * in the order passed. So text1 will replace {0}, text2 will replace {1}, * and so forth. * * textX Up to four replacement parameters. They can be provided * as either XMLCh strings, or local code page strings which * will be transcoded internally. * * @param toEmit The error code to emit. it must be one of the defined * validator error codes. * */ void emitError(const XMLValid::Codes toEmit); void emitError ( const XMLValid::Codes toEmit , const XMLCh* const text1 , const XMLCh* const text2 = 0 , const XMLCh* const text3 = 0 , const XMLCh* const text4 = 0 ); void emitError ( const XMLValid::Codes toEmit , const char* const text1 , const char* const text2 = 0 , const char* const text3 = 0 , const char* const text4 = 0 ); //@} // ----------------------------------------------------------------------- // Deprecated XMLValidator interface // ----------------------------------------------------------------------- /** * * DEPRECATED. * For those validators that contrain the possible root elements of a * document to only particular elements, they should use this call to * validate that the passed root element id is a legal root element. */ bool checkRootElement ( const unsigned int ) { return true;}; // ----------------------------------------------------------------------- // Notification that lazy data has been deleted // ----------------------------------------------------------------------- static void reinitMsgMutex(); static void reinitMsgLoader();protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- XMLValidator ( XMLErrorReporter* const errReporter = 0 ); // ----------------------------------------------------------------------- // Protected getters // ----------------------------------------------------------------------- const XMLBufferMgr* getBufMgr() const; XMLBufferMgr* getBufMgr(); const ReaderMgr* getReaderMgr() const; ReaderMgr* getReaderMgr(); const XMLScanner* getScanner() const; XMLScanner* getScanner();private : // ----------------------------------------------------------------------- // Unimplemented Constructors and Operators // ----------------------------------------------------------------------- XMLValidator(const XMLValidator&); XMLValidator& operator=(const XMLValidator&); // ----------------------------------------------------------------------- // Private data members // // fErrorReporter // The error reporter we are to use, if any. // // ----------------------------------------------------------------------- XMLBufferMgr* fBufMgr; XMLErrorReporter* fErrorReporter; ReaderMgr* fReaderMgr; XMLScanner* fScanner;};// -----------------------------------------------------------------------// Setter methods// -----------------------------------------------------------------------inline voidXMLValidator::setScannerInfo(XMLScanner* const owningScanner , ReaderMgr* const readerMgr , XMLBufferMgr* const bufMgr){ // We don't own any of these, we just reference them fScanner = owningScanner; fReaderMgr = readerMgr; fBufMgr = bufMgr;}inline voidXMLValidator::setErrorReporter(XMLErrorReporter* const errorReporter){ fErrorReporter = errorReporter;}// ---------------------------------------------------------------------------// XMLValidator: Protected getter// ---------------------------------------------------------------------------inline const XMLBufferMgr* XMLValidator::getBufMgr() const{ return fBufMgr;}inline XMLBufferMgr* XMLValidator::getBufMgr(){ return fBufMgr;}inline const ReaderMgr* XMLValidator::getReaderMgr() const{ return fReaderMgr;}inline ReaderMgr* XMLValidator::getReaderMgr(){ return fReaderMgr;}inline const XMLScanner* XMLValidator::getScanner() const{ return fScanner;}inline XMLScanner* XMLValidator::getScanner(){ return fScanner;}XERCES_CPP_NAMESPACE_END#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -