LibKEduVocDocument

keduvocvokabelnreader.h
1/*
2 create a KEduVocDocument from a Vokabeln file
3 -----------------------------------------------------------------------
4 * SPDX-FileCopyrightText: 2007 Peter Hedlund <peter.hedlund@kdemail.net>
5
6
7 * SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#ifndef KEDUVOCVOKABELNREADER_H
10#define KEDUVOCVOKABELNREADER_H
11
12#include "keduvocdocument.h"
13#include "readerbase.h"
14#include <QString>
15
16class QIODevice;
17class KEduVocDocument;
18
19/** @brief Vokabeln Reader*/
21{
22public:
23 /** constructor
24 @param file an device open for read
25 */
26 explicit KEduVocVokabelnReader(QIODevice &file);
27
28 /**destructor*/
30
31 /** @brief Can this reader parse this file
32 *
33 Read a small portion of the header of the file
34 and decide if it is a suitable type.
35 @return true if parsable
36 */
37 bool isParsable() Q_DECL_OVERRIDE;
38
39 /** @brief returns the KEduVocDocument::FileType that this reader handles
40 @return KEduVocDocument::FileType handled
41 */
42 KEduVocDocument::FileType fileTypeHandled() Q_DECL_OVERRIDE;
43
44 /** @brief Parse file and write into doc
45 @param doc to be written
46 @return error status of the read.*/
47 KEduVocDocument::ErrorCode read(KEduVocDocument &doc) Q_DECL_OVERRIDE;
48
49 /** an error message.
50 @return the error message
51 */
52 QString errorMessage() const Q_DECL_OVERRIDE
53 {
54 return m_errorMessage;
55 }
56
57private:
58 QIODevice *m_inputFile; ///< input device
59 KEduVocDocument *m_doc; ///< output doc
60 QString m_errorMessage; ///< error message
61};
62
63#endif
The primary entry point to the hierarchy of objects describing vocabularies.
KEduVocDocument::ErrorCode read(KEduVocDocument &doc) override
Parse file and write into doc.
KEduVocDocument::FileType fileTypeHandled() override
returns the KEduVocDocument::FileType that this reader handles
KEduVocVokabelnReader(QIODevice &file)
constructor
bool isParsable() override
Can this reader parse this file.
~KEduVocVokabelnReader() override
destructor
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 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.