4#ifndef FILESIGNIFICANCECHECK_H
5#define FILESIGNIFICANCECHECK_H
7#include <QtCore/qdir.h>
8#include <QtCore/qreadwritelock.h>
9#include <QtCore/qregularexpression.h>
10#include <QtCore/qstringlist.h>
11#include <QtCore/qvector.h>
14#include <unordered_map>
19class FileSignificanceCheck
22 FileSignificanceCheck() =
default;
26 m_instance =
new FileSignificanceCheck;
35 static FileSignificanceCheck *the()
40 void setRootDirectories(
const QStringList &paths);
41 void setExclusionRegExes(
const QVector<QRegularExpression> &expressions);
43 bool isFileSignificant(
const std::string &filePath)
const;
46 static FileSignificanceCheck *m_instance;
47 std::vector<QDir> m_rootDirs;
48 QVector<QRegularExpression> m_exclusionRegExes;
49 mutable std::unordered_map<std::string,
bool> m_cache;
50 mutable QReadWriteLock m_cacheLock;
57 return FileSignificanceCheck::the()->isFileSignificant(filePath);
void HandleTranslationUnit(clang::ASTContext &context) override
LupdateASTConsumer(clang::ASTContext *context, Stores *stores)
std::unique_ptr< clang::ASTConsumer > CreateASTConsumer(clang::CompilerInstance &compiler, llvm::StringRef) override
LupdateFrontendAction(Stores *stores)
bool operator()(const clang::RawComment &LHS, const clang::RawComment &RHS)
BeforeThanCompare(const clang::SourceManager &SM)
bool operator()(const clang::RawComment *LHS, const clang::RawComment *RHS)
bool VisitNamedDecl(clang::NamedDecl *namedDeclaration)
void findContextForTranslationStoresFromPP(clang::NamedDecl *namedDeclaration)
LupdateVisitor(clang::ASTContext *context, Stores *stores)
bool VisitCallExpr(clang::CallExpr *callExpression)
void processPreprocessorCalls()
QT_WARNING_PUSH QT_WARNING_POP QT_BEGIN_NAMESPACE QString toQt(llvm::StringRef str)
#define LUPDATE_CLANG_VERSION
#define LUPDATE_CLANG_VERSION_CHECK(major, minor, patch)
std::vector< std::string > getAliasFunctionDefinition()
void finalize(ReadSynchronizedRef< TranslationRelatedStore > &ast, WriteSynchronizedRef< TranslationRelatedStore > &newAst)
bool stringContainsTranslationInformation(llvm::StringRef ba)
void correctAstTranslationContext(ReadSynchronizedRef< TranslationRelatedStore > &ast, WriteSynchronizedRef< TranslationRelatedStore > &newAst, const TranslationStores &qDecl)
void collectMessages(TranslatorMessageVector &result, TranslationRelatedStore &store)
TranslatorMessage translatorMessage(const TranslationRelatedStore &store, const QString &id, bool plural, bool isID, bool isWarningOnly=false)
void loadCPP(Translator &translator, const QStringList &filenames, ConversionData &cd, bool *fail)
bool hasQuote(llvm::StringRef source)
QString cleanQuote(const std::string &token)
void exploreChildrenForFirstStringLiteral(clang::Stmt *stmt, QString &context)
bool trFunctionPresent(llvm::StringRef text)
QString exploreBases(clang::CXXRecordDecl *recordDecl, const clang::SourceManager &sm)
QString cleanQuote(llvm::StringRef s, QuoteCompulsary quote)
bool isPointWithin(const clang::SourceRange &sourceRange, const clang::SourceLocation &point, const clang::SourceManager &sm)
bool isQObjectOrQDeclareTrFunctionMacroDeclared(clang::CXXRecordDecl *recordDecl, QString &context, const clang::SourceManager &sm)
static bool capture(const QRegularExpression &exp, const QString &line, QString *i, QString *c)
bool isFileSignificant(const std::string &filePath)
QString fixedLineEndings(const QString &s)
QString contextForFunctionDecl(clang::FunctionDecl *func, const std::string &funcName)
QString contextForNoopMacro(clang::NamedDecl *namedDecl, const clang::SourceManager &sm)
QString lookForContext(clang::CXXRecordDecl *recordDecl, const clang::SourceManager &sm)
Combined button and popup list for selecting options.
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher)
Stores(TranslationStores &a, TranslationStores &qd, TranslationStores &qn)
WriteSynchronizedRef< TranslationRelatedStore > QDeclareTrWithContext
WriteSynchronizedRef< TranslationRelatedStore > QNoopTranlsationWithContext
TranslationStores Preprocessor
WriteSynchronizedRef< TranslationRelatedStore > AST