File indexing completed on 2024-04-28 05:48:21

0001 #pragma once
0002 
0003 #include <QHash>
0004 #include <QString>
0005 
0006 namespace KTextEditor
0007 {
0008 class MainWindow;
0009 }
0010 
0011 class CompileDBReader
0012 {
0013 public:
0014     //     CompileDBReader(const QString &path);
0015 
0016     /**
0017      * Locate compile_commands.json file
0018      */
0019     static QString locateCompileCommands(KTextEditor::MainWindow *mw, const QString &openedFile);
0020 
0021     /**
0022      * Get compiler args for file
0023      */
0024     static QString argsForFile(const QString &compile_commandsPath, const QString &file);
0025 
0026     /**
0027      * Filter some args like -o file.o
0028      *
0029      * adds the path of @file to compile_commands
0030      */
0031     static QString filteredArgsForFile(const QString &compile_commandsPath, const QString &file);
0032 
0033     // private:
0034     //     void readCompileCommands();
0035     //
0036     //     QHash<QString, QString> m_fileToArgs;
0037 };