Changeset View
Changeset View
Standalone View
Standalone View
src/metadata/poextractor.h
Show All 26 Lines | |||||
27 | 27 | | |||
28 | #include "filemetadata.h" | 28 | #include "filemetadata.h" | ||
29 | 29 | | |||
30 | class POExtractor | 30 | class POExtractor | ||
31 | { | 31 | { | ||
32 | 32 | | |||
33 | public: | 33 | public: | ||
34 | POExtractor(); | 34 | POExtractor(); | ||
35 | void extract(const QString& filePath, FileMetaData& data); | 35 | FileMetaData extract(const QString& filePath); | ||
36 | 36 | | |||
37 | private: | 37 | private: | ||
38 | void endMessage(); | 38 | void endMessage(); | ||
39 | void handleComment(const char* data, uint32_t length); | 39 | void handleComment(const char* data, uint32_t length); | ||
40 | void handleLine(const char* data, uint32_t length); | 40 | void handleLine(const char* data, uint32_t length); | ||
41 | 41 | | |||
42 | 42 | | |||
43 | enum PoState {COMMENT, MSGCTXT, MSGID, MSGID_PLURAL, MSGSTR, MSGSTR_PLURAL, | 43 | enum PoState {COMMENT, MSGCTXT, MSGID, MSGID_PLURAL, MSGSTR, MSGSTR_PLURAL, | ||
44 | WHITESPACE, ERROR | 44 | WHITESPACE, ERROR | ||
45 | }; | 45 | }; | ||
46 | PoState state; | 46 | PoState state; | ||
47 | int messages; | 47 | int messages; | ||
48 | int untranslated; | 48 | int untranslated; | ||
49 | int fuzzy; | 49 | int fuzzy; | ||
50 | bool isFuzzy, isTranslated; | 50 | bool isFuzzy, isTranslated; | ||
51 | }; | 51 | }; | ||
52 | 52 | | |||
53 | | ||||
54 | #endif // PLAINTEXTEXTRACTOR_H | 53 | #endif // PLAINTEXTEXTRACTOR_H |