KFileMetaData

poextractor.h
1/*
2 Gettext translation file analyzer
3
4 SPDX-FileCopyrightText: 2007 Montel Laurent <montel@kde.org>
5 SPDX-FileCopyrightText: 2009 Jos van den Oever <jos@vandenoever.info>
6 SPDX-FileCopyrightText: 2014 Nick Shaforostoff <shaforostoff@gmail.com>
7
8 SPDX-License-Identifier: LGPL-2.1-or-later
9*/
10
11
12#ifndef POEXTRACTOR_H
13#define POEXTRACTOR_H
14
15#include "extractorplugin.h"
16
17namespace KFileMetaData
18{
19
20class POExtractor : public ExtractorPlugin
21{
23 Q_PLUGIN_METADATA(IID "org.kde.kf5.kfilemetadata.ExtractorPlugin"
24 FILE "poextractor.json")
26
27public:
28 explicit POExtractor(QObject* parent = nullptr);
29
30 QStringList mimetypes() const override;
31 void extract(ExtractionResult* result) override;
32
33private:
34 void endMessage();
35 void handleComment(const char* data, quint32 length);
36 void handleLine(const char* data, quint32 length);
37
38
39 enum PoState {COMMENT, MSGCTXT, MSGID, MSGID_PLURAL, MSGSTR, MSGSTR_PLURAL,
40 WHITESPACE, ERROR};
41 PoState state;
42 int messages;
43 int untranslated;
44 int fuzzy;
45 bool isFuzzy=false, isTranslated=false;
46};
47
48}
49
50#endif // PLAINTEXTEXTRACTOR_H
The ExtractorPlugin is the base class for all file metadata extractors.
The KFileMetaData namespace.
Q_INTERFACES(...)
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 1 2024 18:49:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.