forked from qt-creator/qt-creator
Clang: Add insert file information to symbol storage
We use INSERT OR REPLACE because it is simpler than the insert and update and we provide the primary key by our self. Change-Id: I868e040918cc6c2ed183cecc746c89bec136f974 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -182,6 +182,10 @@ public:
|
||||
"DELETE FROM newUsedMacros",
|
||||
database
|
||||
};
|
||||
WriteStatement insertFileInformations{
|
||||
"INSERT OR REPLACE INTO fileInformations(sourceId, size, lastModified) VALUES (?,?,?)",
|
||||
database
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace ClangBackEnd
|
||||
|
||||
@@ -108,6 +108,16 @@ public:
|
||||
insertStatement.write(projectPartId, sourceFilePathId.filePathId);
|
||||
}
|
||||
|
||||
void insertFileInformations(const FileInformations &fileInformations)
|
||||
{
|
||||
WriteStatement &statement = m_statementFactory.insertFileInformations;
|
||||
|
||||
for (const FileInformation &fileInformation : fileInformations)
|
||||
statement.write(fileInformation.filePathId.filePathId,
|
||||
fileInformation.size,
|
||||
fileInformation.lastModified);
|
||||
}
|
||||
|
||||
static Utils::SmallString toJson(const Utils::SmallStringVector &strings)
|
||||
{
|
||||
QJsonDocument document;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "fileinformation.h"
|
||||
#include "projectpartentry.h"
|
||||
#include "sourcelocationentry.h"
|
||||
#include "symbolentry.h"
|
||||
@@ -50,6 +51,7 @@ public:
|
||||
virtual void updateProjectPartSources(Utils::SmallStringView projectPartName,
|
||||
const FilePathIds &sourceFilePathIds) = 0;
|
||||
virtual void insertOrUpdateUsedMacros(const UsedMacros &usedMacros) = 0;
|
||||
virtual void insertFileInformations(const FileInformations &fileInformations) = 0;
|
||||
};
|
||||
|
||||
} // namespace ClangBackEnd
|
||||
|
||||
Reference in New Issue
Block a user