Sharg 1.2.3-rc.1
The argument parser for bio-c++ tools.
Loading...
Searching...
No Matches
auxiliary.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2026, Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2026, Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <string>
13#include <vector>
14
15#include <sharg/platform.hpp>
16
17namespace sharg
18{
19
26enum class update_notifications : uint8_t
27{
28 on,
29 off
30};
31
37class vector_of_string : public std::vector<std::string>
38{
39private:
42
43public:
44 using base_t::base_t;
45
46 vector_of_string() = default;
51 ~vector_of_string() = default;
52
54 template <typename... t>
55 requires std::constructible_from<std::string, t...>
56 constexpr vector_of_string(t &&... str) : base_t{std::string(std::forward<t>(str)...)}
57 {}
58
60 template <typename Iter>
62 && std::same_as<std::decay_t<Iter>, std::string::value_type *>
63 constexpr vector_of_string(Iter begin, Iter end) : base_t{std::string(begin, end)}
64 {}
65
69};
70
98struct parser_meta_data // holds all meta information
99{
105 std::string app_name{};
106
108 std::string version{};
109
111 std::string short_description{};
112
114 std::string author{};
115
117 std::string email{};
118
123
126
128 std::string short_copyright{};
129
133 std::string long_copyright{};
134
137
141 std::string man_page_title{};
142
144 unsigned man_page_section{1};
145
152
157
163
165 constexpr friend bool operator==(parser_meta_data, parser_meta_data) = default;
167};
168
169} // namespace sharg
A std::vector<std::string> that can also be constructed from std::string.
Definition auxiliary.hpp:38
vector_of_string()=default
Defaulted.
constexpr vector_of_string(std::initializer_list< std::string::value_type > il)
Construct from an initializer list.
Definition auxiliary.hpp:67
vector_of_string & operator=(vector_of_string const &)=default
Defaulted.
vector_of_string(vector_of_string const &)=default
Defaulted.
~vector_of_string()=default
Defaulted.
constexpr vector_of_string(Iter begin, Iter end)
Construct from iterator pair.
Definition auxiliary.hpp:63
vector_of_string & operator=(vector_of_string &&)=default
Defaulted.
constexpr vector_of_string(t &&... str)
Delegate to std::string constructor if possible.
Definition auxiliary.hpp:56
vector_of_string(vector_of_string &&)=default
Defaulted.
update_notifications
Indicates whether application allows automatic update notifications by the sharg::parser.
Definition auxiliary.hpp:27
@ off
Automatic update notifications should be disabled.
@ on
Automatic update notifications should be enabled.
T is_same_v
Provides platform and dependency checks.
Stores all parser related meta information of the sharg::parser.
Definition auxiliary.hpp:99
Hide me