KFileMetaData

poextractor.h
1 /*
2  Gettext translation file analyzer
3 
4  SPDX-FileCopyrightText: 2007 Montel Laurent <[email protected]>
5  SPDX-FileCopyrightText: 2009 Jos van den Oever <[email protected]>
6  SPDX-FileCopyrightText: 2014 Nick Shaforostoff <[email protected]>
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 
17 namespace KFileMetaData
18 {
19 
20 class POExtractor : public ExtractorPlugin
21 {
22  Q_OBJECT
23  Q_PLUGIN_METADATA(IID "org.kde.kf5.kfilemetadata.ExtractorPlugin"
24  FILE "poextractor.json")
26 
27 public:
28  explicit POExtractor(QObject* parent = nullptr);
29 
30  QStringList mimetypes() const override;
31  void extract(ExtractionResult* result) override;
32 
33 private:
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
Q_OBJECTQ_OBJECT
Q_INTERFACES(...)
The ExtractorPlugin is the base class for all file metadata extractors. It is responsible for extract...
virtual QStringList mimetypes() const =0
Provide a list of mimetypes which are supported by this plugin.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu May 26 2022 03:46:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.