logic: reduce access to filesystem while indexing

* use canonical filepath cache in cxx indexer
* made constructors of FilePath explicit
* use FilePath at more places instead of string
* forward declares FilePath wherever possible
This commit is contained in:
malte_langkabel
2017-05-04 10:55:16 +02:00
parent 55d3f9c189
commit 054b8fab17
156 changed files with 656 additions and 444 deletions
+3 -3
View File
@@ -22,7 +22,7 @@ FileLogger::~FileLogger()
{
}
void FileLogger::setLogDirectory(const std::string& filePath)
void FileLogger::setLogDirectory(const FilePath& filePath)
{
m_logDirectory = filePath;
FileSystem::createDirectory(m_logDirectory);
@@ -90,14 +90,14 @@ void FileLogger::updateLogFileName()
if (fileChanged)
{
FileSystem::remove(m_logDirectory + m_currentLogFileName);
FileSystem::remove(m_logDirectory.concat(FilePath(m_currentLogFileName)));
}
}
void FileLogger::logMessage(const std::string& type, const LogMessage& message)
{
std::ofstream fileStream;
fileStream.open(m_logDirectory + m_currentLogFileName, std::ios::app);
fileStream.open(m_logDirectory.concat(FilePath(m_currentLogFileName)).str(), std::ios::app);
fileStream << message.getTimeString("%H:%M:%S") << " | ";
fileStream << message.threadId << " | ";