LibKEduVocDocument

keduvocpaukerreader.h
1/*
2 * create a KEduVocDocument from a Pauker file
3 * SPDX-FileCopyrightText: 2004, 2007 Peter Hedlund <peter.hedlund@kdemail.net>
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KEDUVOCPAUKERREADER_H
8#define KEDUVOCPAUKERREADER_H
9
10#include "keduvocdocument.h"
11#include "readerbase.h"
12#include <QXmlStreamReader>
13
14class QIODevice;
15class KEduVocDocument;
16
17/** @brief Reader for the Pauker format*/
19{
20public:
21 /** constructor
22 @param file an device open for read
23 */
24 explicit KEduVocPaukerReader(QIODevice &file);
25 /**destructor*/
27
28 /** @brief Can this reader parse this file
29 *
30 Read a small portion of the header of the file
31 and decide if it is a suitable type.
32 @return true if parsable
33 */
34 bool isParsable() Q_DECL_OVERRIDE;
35
36 /** @brief returns the KEduVocDocument::FileType that this reader handles
37 @return KEduVocDocument::FileType handled
38 */
39 KEduVocDocument::FileType fileTypeHandled() Q_DECL_OVERRIDE;
40
41 /** @brief Parse file and write into doc
42 @param doc to be written
43 @return error status of the read.*/
44 KEduVocDocument::ErrorCode read(KEduVocDocument &doc) Q_DECL_OVERRIDE;
45
46 /** an error message.
47 @return the error message
48 */
49 QString errorMessage() const Q_DECL_OVERRIDE;
50
51private:
52 /** Skip unknown tags*/
53 void readUnknownElement();
54 /** Read Pauker tag*/
55 void readPauker();
56 /** Read a batch tag*/
57 void readBatch();
58 /** Read a card tag*/
59 void readCard();
60 /** Read a Text tag
61 @return the tag */
62 QString readText();
63
64 KEduVocDocument *m_doc; ///< output doc
65 QIODevice &m_dev; ///< input device/file
66};
67
68#endif
The primary entry point to the hierarchy of objects describing vocabularies.
Reader for the Pauker format.
bool isParsable() override
Can this reader parse this file.
~KEduVocPaukerReader() override
destructor
KEduVocDocument::FileType fileTypeHandled() override
returns the KEduVocDocument::FileType that this reader handles
KEduVocPaukerReader(QIODevice &file)
constructor
KEduVocDocument::ErrorCode read(KEduVocDocument &doc) override
Parse file and write into doc.
QString errorMessage() const override
an error message.
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 Fri May 17 2024 11:55:29 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.