Go to the documentation of this file.
4 #ifndef LEXY_INPUT_ARGV_INPUT_HPP_INCLUDED
5 #define LEXY_INPUT_ARGV_INPUT_HPP_INCLUDED
28 constexpr
const char&
deref() const noexcept
64 return _arg == rhs._arg &&
_c == rhs._c;
66 constexpr
bool is_end() const noexcept
70 return _c ==
nullptr || (*
_c ==
'\0' &&
_arg[1] ==
nullptr);
118 template <
typename Encoding = default_encoding>
124 static_assert(std::is_same_v<char_type, char>
125 || Encoding::template is_secondary_char_type<char>(),
126 "invalid encoding for argv");
155 template <
typename Encoding = default_encoding>
158 template <
typename Tag,
typename Encoding = default_encoding>
161 template <
typename Encoding = default_encoding>
169 template <
typename Reader>
172 typename Reader::marker
end;
174 constexpr
explicit tp(
const Reader& reader) :
end(reader.current()) {}
176 constexpr
auto try_parse([[maybe_unused]] Reader reader)
178 using encoding =
typename Reader::encoding;
181 if (reader.peek() != lexy::_detail::transcode_int<encoding>(
'\0'))
185 end = reader.current();
190 return std::false_type{};
194 template <
typename Context>
214 #endif // LEXY_INPUT_ARGV_INPUT_HPP_INCLUDED
constexpr bool equal(argv_iterator rhs) const noexcept
constexpr friend argv_iterator argv_begin(int argc, char *argv[]) noexcept
Returns an iterator to the beginning of the command-line arguments.
string_view::value_type char_type
constexpr argv_iterator argv_end(int argc, char *argv[]) noexcept
Returns an iterator one past the end of the command-line arguments.
constexpr bool is_end() const noexcept
constexpr void report_error(Context &context, const Reader &reader)
Contains information about the context of an error, production is type-erased.
#define LEXY_PRECONDITION(Expr)
constexpr argv_iterator() noexcept
constexpr auto end(const C &c) -> decltype(c.end())
constexpr auto try_parse([[maybe_unused]] Reader reader)
constexpr argv_iterator(char **argument, char *c) noexcept
constexpr friend argv_iterator argv_end(int argc, char *argv[]) noexcept
Returns an iterator one past the end of the command-line arguments.
A sentinel for the command-line arguments.
constexpr auto begin(const C &c) -> decltype(c.begin())
constexpr argv_iterator argv_begin(int argc, char *argv[]) noexcept
Returns an iterator to the beginning of the command-line arguments.
argv_input(int argc, char *argv[]) -> argv_input<>
constexpr void decrement() noexcept
constexpr void increment() noexcept
constexpr tp(const Reader &reader)
decltype(LEXY_DECLVAL(Input).reader()) input_reader
constexpr auto argv_separator
Matches the separator between arguments of an argv_input.
constexpr const char & deref() const noexcept
An iterator over the command-line arguments.