QXmlEntityResolver Class

QXmlEntityResolver 클래스는 XML 데이터에 포함된 외부 엔티티를 해결하기 위한 인터페이스를 제공합니다. 더 보기...

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

QXmlDefaultHandler

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

공용 함수

virtual ~QXmlEntityResolver()
virtual QString errorString() const = 0
virtual bool resolveEntity(const QString &publicId, const QString &systemId, QXmlInputSource *&ret) = 0

상세 설명

애플리케이션이 외부 엔티티에 대한 사용자 정의 처리를 구현해야 하는 경우 이 인터페이스( resolveEntity())를 구현하고 QXmlReader::setEntityResolver()에 등록해야 합니다.

QXmlDTDHandler, QXmlDeclHandler, QXmlContentHandler, QXmlErrorHandler, QXmlLexicalHandler참조하세요 .

멤버 함수 문서

[virtual noexcept] QXmlEntityResolver::~QXmlEntityResolver()

엔티티 리졸버를 파괴합니다.

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

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

[pure virtual] bool QXmlEntityResolver::resolveEntity(const QString &publicId, const QString &systemId, QXmlInputSource *&ret)

리더는 최상위 문서 엔티티를 제외한 외부 엔티티를 열기 전에 이 함수를 호출합니다. 애플리케이션은 리더에 엔티티 자체를 확인하거나(ret 은 0) 완전히 다른 입력 소스(ret 은 입력 소스를 가리킴)를 사용하도록 요청할 수 있습니다.

리더는 더 이상 필요하지 않으면 입력 소스 ret 를 삭제하므로 new 를 사용하여 힙에 할당해야 합니다.

인자 publicId 는 외부 엔티티의 공개 식별자, systemId 는 외부 엔티티의 시스템 식별자, ret 는 이 함수의 반환값입니다. ret 가 0이면 리더는 엔티티 자체를 해석해야 하며, 0이 아닌 경우 리더가 대신 사용하는 입력 소스를 가리켜야 합니다.

이 함수가 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.