From: Joel Rosdahl Date: Sun, 2 Jun 2024 08:48:39 +0000 (+0200) Subject: enhance: Add Args::push_back(const std::filesystem::path&) X-Git-Tag: v4.11~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abd6e87fe9386539b1c3b626d088c84678f3b1fc;p=thirdparty%2Fccache.git enhance: Add Args::push_back(const std::filesystem::path&) --- diff --git a/src/ccache/Args.hpp b/src/ccache/Args.hpp index dffdffd9..0f0158c4 100644 --- a/src/ccache/Args.hpp +++ b/src/ccache/Args.hpp @@ -19,6 +19,7 @@ #pragma once #include +#include #include #include #include @@ -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()); +}