QXmlErrorHandler Class

QXmlErrorHandler 클래스는 XML 데이터의 오류를 보고하는 인터페이스를 제공합니다. 더 보기...

Header: #include <QXmlErrorHandler>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core5Compat)
target_link_libraries(mytarget PRIVATE Qt6::Core5Compat)
qmake: QT += core5compat
상속 대상:

QXmlDefaultHandler

참고: 이 클래스의 모든 함수는 재진입됩니다.

공용 함수

virtual ~QXmlErrorHandler()
virtual bool error(const QXmlParseException &exception) = 0
virtual QString errorString() const = 0
virtual bool fatalError(const QXmlParseException &exception) = 0
virtual bool warning(const QXmlParseException &exception) = 0

상세 설명

애플리케이션에서 사용자에게 오류를 보고하거나 사용자 정의 오류 처리를 수행하려면 이 클래스를 서브클래싱해야 합니다.

QXmlReader::setErrorHandler()로 오류 처리기를 설정할 수 있습니다.

오류는 warning(), error() 및 fatalError()를 사용하여 보고할 수 있으며, 오류 텍스트는 errorString()로 보고합니다.

QXmlDTDHandler, QXmlDeclHandler, QXmlContentHandler, QXmlEntityResolver, QXmlLexicalHandler도 참조하세요 .

멤버 함수 문서

[virtual noexcept] QXmlErrorHandler::~QXmlErrorHandler()

오류 처리기를 삭제합니다.

[pure virtual] bool QXmlErrorHandler::error(const QXmlParseException &exception)

독자는 이 함수를 사용하여 복구 가능한 오류를 보고할 수 있습니다. 복구 가능한 오류는 XML 1.0 사양 1.2절의 "오류"의 정의에 해당합니다. 오류에 대한 자세한 내용은 exception 에 저장됩니다.

리더는 이 함수를 호출한 후에도 정상적인 구문 분석 이벤트를 계속 제공해야 합니다.

이 함수가 false 을 반환하면 리더는 구문 분석을 중지하고 오류를 보고합니다. 리더는 errorString() 함수를 사용하여 오류 메시지를 가져옵니다.

[pure virtual] QString QXmlErrorHandler::errorString() const

핸들러 함수 중 하나라도 false 를 반환하면 리더는 이 함수를 호출하여 오류 문자열을 가져옵니다.

[pure virtual] bool QXmlErrorHandler::fatalError(const QXmlParseException &exception)

독자는 복구할 수 없는 오류를 신고하려면 이 기능을 사용해야 합니다. 오류에 대한 자세한 내용은 exception 에 저장됩니다.

이 함수가 true 을 반환하면 리더는 구문 분석을 계속하여 추가 오류를 보고하려고 시도할 수 있지만 일반 구문 분석 이벤트는 보고되지 않습니다.

[pure virtual] bool QXmlErrorHandler::warning(const QXmlParseException &exception)

독자는 이 기능을 사용하여 경고를 보고할 수 있습니다. 경고는 XML 1.0 사양에 정의된 대로 오류나 치명적인 오류가 아닌 상태입니다. 경고에 대한 자세한 내용은 exception 에 저장됩니다.

이 함수가 false 을 반환하면 리더는 구문 분석을 중지하고 오류를 보고합니다. 리더는 errorString() 함수를 사용하여 오류 메시지를 가져옵니다.

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.