• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

STEllAR-GROUP / hpx / #882

31 Aug 2023 07:44PM UTC coverage: 41.798% (-44.7%) from 86.546%
#882

push

19442 of 46514 relevant lines covered (41.8%)

126375.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/libs/core/program_options/src/split.cpp
1
//  Copyright Sascha Ochsenknecht 2009.
2
//
3
//  SPDX-License-Identifier: BSL-1.0
4
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
5
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6

7
#include <hpx/program_options/config.hpp>
8
#include <hpx/modules/string_util.hpp>
9
#include <hpx/program_options/parsers.hpp>
10

11
#include <string>
12
#include <vector>
13

14
namespace hpx::program_options::detail {
15

16
    template <typename Char>
17
    std::vector<std::basic_string<Char>> split_unix(
84✔
18
        std::basic_string<Char> const& cmdline,
19
        std::basic_string<Char> const& separator,
20
        std::basic_string<Char> const& quote,
21
        std::basic_string<Char> const& escape)
22
    {
23
        hpx::string_util::tokenizer tok(cmdline.begin(), cmdline.end(),
24
            hpx::string_util::escaped_list_separator<Char>(
252✔
25
                escape, separator, quote));
26

27
        std::vector<std::basic_string<Char>> result;
84✔
28
        for (auto cur_token(tok.begin()), end_token(tok.end());
29
            cur_token != end_token; ++cur_token)
375✔
30
        {
31
            if (!cur_token->empty())
291✔
32
                result.push_back(*cur_token);
291✔
33
        }
34
        return result;
84✔
35
    }
×
36
}    // namespace hpx::program_options::detail
37

38
namespace hpx::program_options {
39

40
    // Take a command line string and splits in into tokens, according
41
    // to the given collection of separators chars.
42
    std::vector<std::string> split_unix(std::string const& cmdline,
84✔
43
        std::string const& separator, std::string const& quote,
44
        std::string const& escape)
45
    {
46
        return detail::split_unix<char>(cmdline, separator, quote, escape);
84✔
47
    }
48

49
    std::vector<std::wstring> split_unix(std::wstring const& cmdline,
×
50
        std::wstring const& separator, std::wstring const& quote,
51
        std::wstring const& escape)
52
    {
53
        return detail::split_unix<wchar_t>(cmdline, separator, quote, escape);
×
54
    }
55
}    // namespace hpx::program_options
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc