data: fixed file clearing to clear only elements with no more source_locations
This commit is contained in:
@@ -58,8 +58,8 @@ public:
|
||||
virtual void startParsing() = 0;
|
||||
virtual void finishParsing() = 0;
|
||||
|
||||
virtual void prepareParsingFile() = 0;
|
||||
virtual void finishParsingFile() = 0;
|
||||
virtual void prepareParsingFile(const FilePath& filePath) = 0;
|
||||
virtual void finishParsingFile(const FilePath& filePath) = 0;
|
||||
|
||||
virtual void onError(const ParseLocation& location, const std::string& message) = 0;
|
||||
virtual size_t getErrorCount() const = 0;
|
||||
|
||||
@@ -29,7 +29,7 @@ void TaskParseCxx::enter()
|
||||
|
||||
for (const FilePath& path : m_parser.getFileRegister()->getUnparsedSourceFilePaths())
|
||||
{
|
||||
m_sourcePaths.push(path.absolute().str());
|
||||
m_sourcePaths.push(path.absolute());
|
||||
}
|
||||
|
||||
m_client->startParsing();
|
||||
@@ -37,7 +37,7 @@ void TaskParseCxx::enter()
|
||||
|
||||
Task::TaskState TaskParseCxx::update()
|
||||
{
|
||||
std::string sourcePath;
|
||||
FilePath sourcePath;
|
||||
bool isSource = false;
|
||||
|
||||
FileRegister* fileRegister = m_parser.getFileRegister();
|
||||
@@ -53,11 +53,11 @@ Task::TaskState TaskParseCxx::update()
|
||||
std::vector<FilePath> unparsedHeaders = fileRegister->getUnparsedIncludeFilePaths();
|
||||
if (unparsedHeaders.size())
|
||||
{
|
||||
sourcePath = unparsedHeaders[0].str();
|
||||
sourcePath = unparsedHeaders[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (!sourcePath.size())
|
||||
if (sourcePath.empty())
|
||||
{
|
||||
return Task::STATE_FINISHED;
|
||||
}
|
||||
@@ -65,19 +65,19 @@ Task::TaskState TaskParseCxx::update()
|
||||
std::stringstream ss;
|
||||
ss << "analyzing files (ESC to quit): [";
|
||||
ss << fileRegister->getParsedFilesCount() << "/" << fileRegister->getFilesCount() << "] ";
|
||||
ss << sourcePath;
|
||||
ss << sourcePath.str();
|
||||
|
||||
MessageStatus(ss.str(), false, true).dispatch();
|
||||
|
||||
m_client->prepareParsingFile();
|
||||
m_client->prepareParsingFile(sourcePath);
|
||||
|
||||
m_parser.runTool(std::vector<std::string>(1, sourcePath));
|
||||
m_parser.runTool(std::vector<std::string>(1, sourcePath.str()));
|
||||
|
||||
m_client->finishParsingFile();
|
||||
m_client->finishParsingFile(sourcePath);
|
||||
|
||||
if (isSource)
|
||||
{
|
||||
fileRegister->markSourceFileParsed(sourcePath);
|
||||
fileRegister->markSourceFileParsed(sourcePath.str());
|
||||
}
|
||||
|
||||
return Task::STATE_RUNNING;
|
||||
|
||||
@@ -32,7 +32,7 @@ private:
|
||||
const Parser::Arguments m_arguments;
|
||||
const std::vector<FilePath> m_files;
|
||||
|
||||
std::queue<std::string> m_sourcePaths;
|
||||
std::queue<FilePath> m_sourcePaths;
|
||||
|
||||
utility::TimePoint m_start;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user