]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
refactor: fs::path-ify core::CacheEntry::Header
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 20 Jan 2024 14:03:42 +0000 (15:03 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 27 Jan 2024 09:50:16 +0000 (10:50 +0100)
src/core/CacheEntry.cpp
src/core/CacheEntry.hpp

index 9ae0de3052876088706feb58d9120ab053085c5e..40f6345042e0aac7ab2104bcc43f9cd535cffb3c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2022-2023 Joel Rosdahl and other contributors
+// Copyright (C) 2022-2024 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -33,6 +33,8 @@
 
 #include <cstring>
 
+namespace fs = util::filesystem;
+
 namespace {
 
 const size_t k_static_header_fields_size =
@@ -104,7 +106,7 @@ CacheEntry::Header::Header(nonstd::span<const uint8_t> data)
   parse(data);
 }
 
-CacheEntry::Header::Header(const std::string& path)
+CacheEntry::Header::Header(const fs::path& path)
 {
   parse(util::value_or_throw<core::Error>(
     util::read_file_part<util::Bytes>(path, 0, 1000)));
index f3c958a1d1bfca07d744b24096d3996e786310d3..74b109bbe0264b8a3ae05bc498445ca3f24d4501 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2021-2022 Joel Rosdahl and other contributors
+// Copyright (C) 2021-2024 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -26,6 +26,7 @@
 #include <third_party/nonstd/span.hpp>
 
 #include <cstdint>
+#include <filesystem>
 #include <functional>
 #include <string>
 
@@ -74,7 +75,7 @@ public:
   public:
     Header(const Config& config, CacheEntryType entry_type);
     explicit Header(nonstd::span<const uint8_t> data);
-    explicit Header(const std::string& path);
+    explicit Header(const std::filesystem::path& path);
 
     std::string inspect() const;