CLI11
2.7.2
C++11 Command Line Interface Parser
Toggle main menu visibility
Loading...
Searching...
No Matches
Split.hpp
1
// Copyright (c) 2017-2026, University of Cincinnati, developed by Henry Schreiner
2
// under NSF AWARD 1414736 and by the respective contributors.
3
// All rights reserved.
4
//
5
// SPDX-License-Identifier: BSD-3-Clause
6
7
#pragma once
8
9
// IWYU pragma: private, include "CLI/CLI.hpp"
10
11
// [CLI11:public_includes:set]
12
#include <iterator>
13
#include <string>
14
#include <tuple>
15
#include <utility>
16
#include <vector>
17
// [CLI11:public_includes:end]
18
19
#include "Macros.hpp"
20
21
namespace
CLI {
22
// [CLI11:split_hpp:verbatim]
23
24
namespace
detail {
25
26
// Returns false if not a short option. Otherwise, sets opt name and rest and returns true
27
CLI11_INLINE
bool
split_short(
const
std::string ¤t, std::string &name, std::string &rest);
28
29
// Returns false if not a long option. Otherwise, sets opt name and other side of = and returns true
30
CLI11_INLINE
bool
split_long(
const
std::string ¤t, std::string &name, std::string &value);
31
32
// Returns false if not a windows style option. Otherwise, sets opt name and value and returns true
33
CLI11_INLINE
bool
split_windows_style(
const
std::string ¤t, std::string &name, std::string &value);
34
35
// Splits a string into multiple long and short names
36
CLI11_INLINE std::vector<std::string> split_names(std::string current);
37
39
CLI11_INLINE std::vector<std::pair<std::string, std::string>> get_default_flag_values(
const
std::string &str);
40
42
CLI11_INLINE std::tuple<std::vector<std::string>, std::vector<std::string>, std::string>
43
get_names(
const
std::vector<std::string> &input,
bool
allow_non_standard =
false
);
44
45
}
// namespace detail
46
// [CLI11:split_hpp:end]
47
}
// namespace CLI
48
49
#ifndef CLI11_COMPILE
50
#include "impl/Split_inl.hpp"
// IWYU pragma: export
51
#endif
include
CLI
Split.hpp
Generated by
1.17.0