LibKEduVocDocument

keduvoccsvreader.h
1/*
2 * create a KEduVocDocument from a text file
3 * SPDX-FileCopyrightText: 2007 Peter Hedlund <peter.hedlund@kdemail.net>
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KEDUVOCCSVREADER_H
8#define KEDUVOCCSVREADER_H
9
10#include "keduvocdocument.h"
11#include "readerbase.h"
12#include <QString>
13
14class QIODevice;
15
16class KEduVocDocument;
17
18/** @brief CSV Reader, the default reader*/
20{
21public:
22 /** constructor
23 @param dev to parse*/
24 explicit KEduVocCsvReader(QIODevice &dev);
25 /** destructor */
26 ~KEduVocCsvReader() override {};
27
28 /** @brief CSV can always parse a file
29 @return true if parsable
30 */
31 bool isParsable() Q_DECL_OVERRIDE
32 {
33 return true;
34 }
35
36 /** @brief returns the KEduVocDocument::FileType that this reader handles
37 @return KEduVocDocument::FileType handled
38 */
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 {
51 return m_errorMessage;
52 }
53
54private:
55 QIODevice *m_inputFile; ///< input device
56 KEduVocDocument *m_doc; ///< output doc
57 QString m_errorMessage; ///< error message
58};
59
60#endif
CSV Reader, the default reader.
bool isParsable() override
CSV can always parse a file.
KEduVocDocument::FileType fileTypeHandled() override
returns the KEduVocDocument::FileType that this reader handles
KEduVocDocument::ErrorCode read(KEduVocDocument &doc) override
Parse file and write into doc.
QString errorMessage() const override
an error message.
~KEduVocCsvReader() override
destructor
KEduVocCsvReader(QIODevice &dev)
constructor
The primary entry point to the hierarchy of objects describing vocabularies.
FileType
known vocabulary file types
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 Sat Dec 21 2024 17:05:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.