File indexing completed on 2023-09-24 06:00:37
0001 /* 0002 This file is part of Lokalize 0003 0004 SPDX-FileCopyrightText: 2009 Nick Shaforostoff <shafff@ukr.net> 0005 SPDX-FileCopyrightText: 2018-2019 Simon Depiets <sdepiets@gmail.com> 0006 0007 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0008 */ 0009 0010 0011 #ifndef COMPLETIONSTORAGE_H 0012 #define COMPLETIONSTORAGE_H 0013 #include <QMap> 0014 #include "catalog.h" 0015 0016 class CompletionStorage 0017 { 0018 private: 0019 CompletionStorage() = default; 0020 ~CompletionStorage() = default; 0021 0022 static CompletionStorage* _instance; 0023 static void cleanupCompletionStorage(); 0024 public: 0025 static CompletionStorage* instance(); 0026 0027 void scanCatalog(Catalog*); 0028 QStringList makeCompletion(const QString&) const; 0029 0030 public: 0031 QRegExp rxSplit{QStringLiteral("\\W+|\\d+")}; 0032 private: 0033 QMap<QString, int> m_words; //how many occurencies a word has 0034 //QSet save which files we scanned? 0035 }; 0036 0037 #endif // COMPLETIONSTORAGE_H