scn namespace

scnlib namespace, containing the library interface

Namespaces

namespace ranges

Classes

template <typename CharT>
struct basic_istream_scanner
template <typename CharT>
class basic_regex_match
template <typename CharT>
class basic_regex_matches
template <typename Context>
class basic_scan_arg
template <typename Context>
class basic_scan_args
template <typename Range, typename CharT>
class basic_scan_context
template <typename CharT, typename Source, typename... Args>
class basic_scan_format_string
template <typename CharT>
class basic_scan_parse_context
struct datetime_components
template <typename T>
struct discard
template <typename T, typename E>
class expected
struct invalid_input_range
struct monostate
Placeholder monostate type.
class scan_error
template <typename T>
struct scan_expected
template <typename Range, typename... Args>
class scan_result
template <typename T, typename CharT = char, typename Enable = void>
struct scanner
template <typename T, typename CharT>
struct scanner<T, CharT, std::enable_if_t<detail::arg_type_constant<T, CharT>::value !=detail::arg_type::custom_type && !detail::is_type_disabled<T>>>
template <typename E>
class unexpected

Typedefs

template <typename Source, typename... Args>
using scan_result_type = scan_expected<scan_result<detail::scan_result_value_type<Source>, Args...>>

Functions

template <typename Result, typename Range, std::enable_if_t<std::conjunction_v<detail::is_specialization_of<Result, scan_result>, std::is_same<typename Result::range_type, Range>>>* = nullptr>
void fill_scan_result(scan_expected<Result>& out, scan_expected<Range>&& in)
template <typename... Args>
auto input(scan_format_string<std::FILE*, Args...> format) →  scan_result_type< std::FILE *, Args... > -> auto
template <typename Context = scan_context, typename... Args>
auto make_scan_args(std::tuple<Args...>& values) →  auto constexpr
template <typename Source, typename... Args>
auto make_scan_result()
template <typename... Args>
auto prompt(const char* msg, scan_format_string<std::FILE*, Args...> format) →  scan_result_type< std::FILE *, Args... > -> auto
auto runtime_format(std::string_view s) →  detail::basic_runtime_format_string<char>
template <typename... Args, typename Source, typename = std::enable_if_t<detail::is_file_or_narrow_range<Source>>>
auto scan(Source&& source, scan_format_string<Source, Args...> format) →  scan_result_type< Source, Args... > -> auto
template <typename... Args, typename Source, typename = std::enable_if_t<detail::is_file_or_narrow_range<Source>>>
auto scan(Source&& source, scan_format_string<Source, Args...> format, std::tuple<Args...>&& initial_args) →  scan_result_type< Source, Args... > -> auto
template <typename... Args, typename Locale, typename Source, typename = std::enable_if_t<detail::is_file_or_narrow_range<Source>>, typename = std::void_t<decltype(Locale::classic())>>
auto scan(const Locale& loc, Source&& source, scan_format_string<Source, Args...> format) →  scan_result_type< Source, Args... > -> auto
template <typename... Args, typename Locale, typename Source, typename = std::enable_if_t<detail::is_file_or_narrow_range<Source>>, typename = std::void_t<decltype(Locale::classic())>>
auto scan(const Locale& loc, Source&& source, scan_format_string<Source, Args...> format, std::tuple<Args...>&& initial_args) →  scan_result_type< Source, Args... > -> auto
template <typename T, std::enable_if_t<detail::is_scan_int_type<T>>* = nullptr>
auto scan_int(std::string_view source, int base = 10) →  scan_result_type< std::string_view, T > -> auto
template <typename T, std::enable_if_t<detail::is_scan_int_type<T>>* = nullptr>
auto scan_int_exhaustive_valid(std::string_view source) →  T -> auto
template <typename T, typename Source, typename = std::enable_if_t<detail::is_file_or_narrow_range<Source>>>
auto scan_value(Source&& source) →  scan_result_type< Source, T > -> auto
template <typename T, typename Source, std::enable_if_t<detail::is_file_or_narrow_range<Source>>* = nullptr>
auto scan_value(Source&& source, T initial_value) →  scan_result_type< Source, T > -> auto
auto vinput(std::string_view format, scan_args args) →  scan_expected<void>
template <typename Source>
auto vscan(Source&& source, std::string_view format, scan_args args) →  vscan_result<Source>
template <typename Source, typename Locale, typename = std::void_t<decltype(Locale::classic())>>
auto vscan(const Locale& loc, Source&& source, std::string_view format, scan_args args) →  vscan_result<Source>
template <typename Range>
auto vscan(Range&& range, std::wstring_view format, wscan_args args) →  vscan_result<Range>
template <typename Range, typename Locale, std::void_t<decltype(Locale::classic())>* = nullptr>
auto vscan(const Locale& loc, Range&& range, std::wstring_view format, wscan_args args) →  vscan_result<Range>
template <typename Source>
auto vscan_value(Source&& source, basic_scan_arg<scan_context> arg) →  vscan_result<Source>
template <typename Range>
auto vscan_value(Range&& range, basic_scan_arg<wscan_context> arg) →  vscan_result<Range>

Typedef documentation

template <typename Source, typename... Args>
using scn::scan_result_type = scan_expected<scan_result<detail::scan_result_value_type<Source>, Args...>>

The return type of scan, based on the type of the source, and the types of the scanned arguments.

Function documentation

template <typename Result, typename Range, std::enable_if_t<std::conjunction_v<detail::is_specialization_of<Result, scan_result>, std::is_same<typename Result::range_type, Range>>>* = nullptr>
void scn::fill_scan_result(scan_expected<Result>& out, scan_expected<Range>&& in)

If in contains a successful result as returned from vscan, the range contained in out is set to *in. Otherwise, unexpected(in.error()) is stored in out.

template <typename Context = scan_context, typename... Args>
auto scn::make_scan_args(std::tuple<Args...>& values) constexpr

Creates a type-erased argument store over the arguments in values.

template <typename Source, typename... Args>
auto scn::make_scan_result()

Returns an empty result type for a source of type Source, and arguments of type Args....