LibKEduVocDocument

keduvocwqlreader.h
1/*
2 * read a KEduVocDocument from a WQL file
3 * SPDX-FileCopyrightText: 2004, 2007 Peter Hedlund <peter.hedlund@kdemail.net>
4 * SPDX-FileCopyrightText: 2005 Eric Pignet
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#ifndef KEDUVOCWQLREADER_H
9#define KEDUVOCWQLREADER_H
10
11#include "keduvocdocument.h"
12#include "readerbase.h"
13#include <QString>
14
15class QIODevice;
16class KEduVocDocument;
17
18/**@brief Reader for WordQuiz files*/
20{
21public:
22 /** constructor
23 @param file an open device
24 */
25 explicit KEduVocWqlReader(QIODevice &file);
26 /**destructor*/
27 ~KEduVocWqlReader() 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 {
52 return m_errorMessage;
53 }
54
55private:
56 QIODevice *m_inputFile; ///< input device
57 KEduVocDocument *m_doc; ///< output doc
58 QString m_errorMessage; ///< error message
59};
60
61#endif
The primary entry point to the hierarchy of objects describing vocabularies.
Reader for WordQuiz files.
QString errorMessage() const override
an error message.
bool isParsable() override
Can this reader parse this file.
~KEduVocWqlReader() override
destructor
KEduVocDocument::ErrorCode read(KEduVocDocument &doc) override
Parse file and write into doc.
KEduVocWqlReader(QIODevice &file)
constructor
KEduVocDocument::FileType fileTypeHandled() override
returns the KEduVocDocument::FileType that this reader handles
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.