summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2022-10-15 20:26:18 +0200
committerJoel Rosdahl <joel@rosdahl.net>2022-10-16 10:50:09 +0200
commit552d736e12931f1c9e286c8495a4687457921ba8 (patch)
tree6f9a088cf8ebbea98ee7090e92bef1b86aa84556 /src/core
parent4ad17e899ddb30a1591829c365c4e7e3b17a5943 (diff)
downloadccache-552d736e12931f1c9e286c8495a4687457921ba8.tar.gz
refactor: Rename ShowIncludesParser to MsvcShowIncludesOutput
I think that this is more in line with what the namespace represents. I also renamed ShowIncludesParser::tokenize to MsvcShowIncludesOutput::get_includes since it's not returning generic tokens but specifically includes files.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/MsvcShowIncludesOutput.cpp (renamed from src/core/ShowIncludesParser.cpp)8
-rw-r--r--src/core/MsvcShowIncludesOutput.hpp (renamed from src/core/ShowIncludesParser.hpp)8
-rw-r--r--src/core/ResultRetriever.cpp4
4 files changed, 11 insertions, 11 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 1fa9f707..c664dda5 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -6,7 +6,7 @@ set(
ResultExtractor.cpp
ResultInspector.cpp
ResultRetriever.cpp
- ShowIncludesParser.cpp
+ MsvcShowIncludesOutput.cpp
Statistics.cpp
StatisticsCounters.cpp
StatsLog.cpp
diff --git a/src/core/ShowIncludesParser.cpp b/src/core/MsvcShowIncludesOutput.cpp
index f05521eb..5289eadc 100644
--- a/src/core/ShowIncludesParser.cpp
+++ b/src/core/MsvcShowIncludesOutput.cpp
@@ -16,16 +16,16 @@
// this program; if not, write to the Free Software Foundation, Inc., 51
// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#include "ShowIncludesParser.hpp"
+#include "MsvcShowIncludesOutput.hpp"
#include <Context.hpp>
#include <Util.hpp>
#include <util/string.hpp>
-namespace core::ShowIncludesParser {
+namespace core::MsvcShowIncludesOutput {
std::vector<std::string_view>
-tokenize(std::string_view file_content, std::string_view prefix)
+get_includes(std::string_view file_content, std::string_view prefix)
{
// /showIncludes output is written to stdout together with other messages.
// Every line of it is "<prefix> <spaces> <file>" where the prefix is "Note:
@@ -73,4 +73,4 @@ strip_includes(const Context& ctx, util::Bytes&& stdout_data)
return util::Bytes(new_stdout_text.data(), new_stdout_text.size());
}
-} // namespace core::ShowIncludesParser
+} // namespace core::MsvcShowIncludesOutput
diff --git a/src/core/ShowIncludesParser.hpp b/src/core/MsvcShowIncludesOutput.hpp
index a368d62b..97c59c06 100644
--- a/src/core/ShowIncludesParser.hpp
+++ b/src/core/MsvcShowIncludesOutput.hpp
@@ -25,11 +25,11 @@
class Context;
-namespace core::ShowIncludesParser {
+namespace core::MsvcShowIncludesOutput {
-std::vector<std::string_view> tokenize(std::string_view file_content,
- std::string_view prefix);
+std::vector<std::string_view> get_includes(std::string_view file_content,
+ std::string_view prefix);
util::Bytes strip_includes(const Context& ctx, util::Bytes&& stdout_data);
-} // namespace core::ShowIncludesParser
+} // namespace core::MsvcShowIncludesOutput
diff --git a/src/core/ResultRetriever.cpp b/src/core/ResultRetriever.cpp
index 484e1632..0aecc17d 100644
--- a/src/core/ResultRetriever.cpp
+++ b/src/core/ResultRetriever.cpp
@@ -24,7 +24,7 @@
#include <Context.hpp>
#include <Stat.hpp>
-#include <core/ShowIncludesParser.hpp>
+#include <core/MsvcShowIncludesOutput.hpp>
#include <core/exceptions.hpp>
#include <core/wincompat.hpp>
#include <fmtmacros.hpp>
@@ -64,7 +64,7 @@ ResultRetriever::on_embedded_file(uint8_t file_number,
if (file_type == FileType::stdout_output) {
Util::send_to_fd(
m_ctx,
- util::to_string_view(ShowIncludesParser::strip_includes(m_ctx, data)),
+ util::to_string_view(MsvcShowIncludesOutput::strip_includes(m_ctx, data)),
STDOUT_FILENO);
} else if (file_type == FileType::stderr_output) {
Util::send_to_fd(m_ctx, util::to_string_view(data), STDERR_FILENO);