]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
enhance: Add Args::push_back(const std::filesystem::path&)
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 2 Jun 2024 08:48:39 +0000 (10:48 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 30 Jun 2024 15:18:49 +0000 (17:18 +0200)
src/ccache/Args.hpp

index dffdffd9cdafb3cccfe932bc7b877e9865e6282b..0f0158c442d43a66c51febe5938e5e7a12f06a39 100644 (file)
@@ -19,6 +19,7 @@
 #pragma once
 
 #include <deque>
+#include <filesystem>
 #include <optional>
 #include <string>
 #include <string_view>
@@ -79,8 +80,10 @@ public:
   void pop_front(size_t count = 1);
 
   // Add `arg` to the end.
+  void push_back(const char* arg);
   void push_back(const std::string& arg);
   void push_back(std::string&& arg);
+  void push_back(const std::filesystem::path& arg);
 
   // Add `args` to the end.
   void push_back(const Args& args);
@@ -131,6 +134,12 @@ Args::operator[](size_t i)
   return m_args[i];
 }
 
+inline void
+Args::push_back(const char* arg)
+{
+  m_args.push_back(arg);
+}
+
 inline void
 Args::push_back(const std::string& arg)
 {
@@ -142,3 +151,9 @@ Args::push_back(std::string&& arg)
 {
   m_args.push_back(arg);
 }
+
+inline void
+Args::push_back(const std::filesystem::path& arg)
+{
+  m_args.push_back(arg.string());
+}