CLI11
2.4.2
Toggle main menu visibility
Loading...
Searching...
No Matches
Split.hpp
Go to the documentation of this file.
1
// Copyright (c) 2017-2024, 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 <string>
13
#include <tuple>
14
#include <utility>
15
#include <vector>
16
// [CLI11:public_includes:end]
17
18
#include "
Macros.hpp
"
19
20
namespace
CLI
{
21
// [CLI11:split_hpp:verbatim]
22
23
namespace
detail
{
24
25
// Returns false if not a short option. Otherwise, sets opt name and rest and returns true
26
CLI11_INLINE
bool
split_short
(
const
std::string ¤t, std::string &name, std::string &rest);
27
28
// Returns false if not a long option. Otherwise, sets opt name and other side of = and returns true
29
CLI11_INLINE
bool
split_long
(
const
std::string ¤t, std::string &name, std::string &value);
30
31
// Returns false if not a windows style option. Otherwise, sets opt name and value and returns true
32
CLI11_INLINE
bool
split_windows_style
(
const
std::string ¤t, std::string &name, std::string &value);
33
34
// Splits a string into multiple long and short names
35
CLI11_INLINE
std::vector<std::string>
split_names
(std::string current);
36
38
CLI11_INLINE
std::vector<std::pair<std::string, std::string>>
get_default_flag_values
(
const
std::string &str);
39
41
CLI11_INLINE
std::tuple<std::vector<std::string>, std::vector<std::string>, std::string>
42
get_names
(
const
std::vector<std::string> &input);
43
44
}
// namespace detail
45
// [CLI11:split_hpp:end]
46
}
// namespace CLI
47
48
#ifndef CLI11_COMPILE
49
#include "impl/Split_inl.hpp"
// IWYU pragma: export
50
#endif
Macros.hpp
CLI11_INLINE
#define CLI11_INLINE
Definition
Macros.hpp:131
CLI::detail
Definition
App.hpp:48
CLI::detail::get_default_flag_values
CLI11_INLINE std::vector< std::pair< std::string, std::string > > get_default_flag_values(const std::string &str)
extract default flag values either {def} or starting with a !
CLI::detail::get_names
CLI11_INLINE std::tuple< std::vector< std::string >, std::vector< std::string >, std::string > get_names(const std::vector< std::string > &input)
Get a vector of short names, one of long names, and a single name.
CLI::detail::split_long
CLI11_INLINE bool split_long(const std::string ¤t, std::string &name, std::string &value)
CLI::detail::split_windows_style
CLI11_INLINE bool split_windows_style(const std::string ¤t, std::string &name, std::string &value)
CLI::detail::split_short
CLI11_INLINE bool split_short(const std::string ¤t, std::string &name, std::string &rest)
CLI::detail::split_names
CLI11_INLINE std::vector< std::string > split_names(std::string current)
CLI
Definition
App.hpp:36
CLI
Split.hpp
Generated by
1.17.0