LibKEduVocDocument

keduvocxdxfreader.h
1/*
2 * create a KEduVocDocument from a XDXF file
3 * SPDX-FileCopyrightText: 2007 Peter Hedlund <peter.hedlund@kdemail.net>
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KEDUVOCXDXFREADER_H
8#define KEDUVOCXDXFREADER_H
9
10#include "keduvocdocument.h"
11#include "readerbase.h"
12#include <QXmlStreamReader>
13
14class QIODevice;
15class KEduVocDocument;
16
17/**@brief Reader for the XDXF format*/
19{
20public:
21 /** constructor
22 @param file an device open for read
23 */
24 explicit KEduVocXdxfReader(QIODevice &file);
25
26 /**destructor*/
27 ~KEduVocXdxfReader() override {};
28
29 /** @brief Can this reader parse this file
30 *
31 Read a small portion of the header of the file
32 and decide if it is a suitable type.
33 @return true if parsable
34 */
35 bool isParsable() Q_DECL_OVERRIDE;
36
37 /** @brief returns the KEduVocDocument::FileType that this reader handles
38 @return KEduVocDocument::FileType handled
39 */
40 KEduVocDocument::FileType fileTypeHandled() Q_DECL_OVERRIDE;
41
42 /** @brief Parse file and write into doc
43 @param doc to be written
44 @return error status of the read.*/
45 KEduVocDocument::ErrorCode read(KEduVocDocument &doc) Q_DECL_OVERRIDE;
46
47 /** an error message.
48 @return the error message
49 */
50 QString errorMessage() const Q_DECL_OVERRIDE;
51
52private:
53 /** Skip unknown tags */
54 void readUnknownElement();
55 /** Read xdxf tag */
56 void readXdxf();
57 /** Read ar tag which is the word pair with "<ar><k>key</k>text</ar>" format */
58 void readEntry();
59
60 KEduVocDocument *m_doc; ///< output doc
61 QIODevice &m_dev; ///< input device
62};
63
64#endif
The primary entry point to the hierarchy of objects describing vocabularies.
Reader for the XDXF format.
QString errorMessage() const override
an error message.
KEduVocDocument::FileType fileTypeHandled() override
returns the KEduVocDocument::FileType that this reader handles
bool isParsable() override
Can this reader parse this file.
KEduVocXdxfReader(QIODevice &file)
constructor
~KEduVocXdxfReader() override
destructor
KEduVocDocument::ErrorCode read(KEduVocDocument &doc) override
Parse file and write into doc.
a base class for readers of various lexicon formats
Definition readerbase.h:20
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.