You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Marton Szasz (Jira)" <ji...@apache.org> on 2022/08/18 16:00:00 UTC

[jira] [Comment Edited] (MINIFICPP-1911) Create concat_path with variadic arguments

    [ https://issues.apache.org/jira/browse/MINIFICPP-1911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17581413#comment-17581413 ] 

Marton Szasz edited comment on MINIFICPP-1911 at 8/18/22 3:59 PM:
------------------------------------------------------------------

{{template<typename First, typename... Rest>}}
{{requires std::is_convertible_v<std::decay_t<First>, std::filesystem::path> && (std::is_convertible_v<std::decay_t<Rest>, std::filesystem::path> && ...)}}
{{inline std::string concat_path(const First& first, const Rest&... rest) {}}
{{  return (std::filesystem::path\{first} / (std::filesystem::path\{rest} / ...)).string();}}
{{}}}


was (Author: szaszm):
template<typename First, typename... Rest>
requires std::is_convertible_v<std::decay_t<First>, std::filesystem::path> && (std::is_convertible_v<std::decay_t<Rest>, std::filesystem::path> && ...)
inline std::string concat_path(const First& first, const Rest&... rest) {
  return (std::filesystem::path\{first} / (std::filesystem::path\{rest} / ...)).string();
}

> Create concat_path with variadic arguments
> ------------------------------------------
>
>                 Key: MINIFICPP-1911
>                 URL: https://issues.apache.org/jira/browse/MINIFICPP-1911
>             Project: Apache NiFi MiNiFi C++
>          Issue Type: Improvement
>            Reporter: Gábor Gyimesi
>            Priority: Minor
>              Labels: MiNiFi-CPP-Hygiene
>
> minifi::utils::file::concat_path in FileUtils.h can only concatenate 2 file path parts which is very limiting. It has 3 parameters: 2 file path parts and a force_posix flag with a default value. This should be improved to have variadic arguments to be able to concatenate any number of file path parts.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)