scn namespace

scnlib namespace, containing the library interface

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 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
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>>>

Typedefs

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

Functions

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() constexpr
template <typename Context = scan_context, typename... Args>
auto make_scan_args(std::tuple<Args...>&& values) →  auto constexpr
template <typename Result, typename... Args>
auto make_scan_result(scan_expected<Result>&& result, std::tuple<Args...>&& args) →  scan_expected< scan_result< Result, Args... >> -> auto
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_error
template <typename Visitor, typename Ctx>
auto visit_scan_arg(Visitor&& vis, basic_scan_arg<Ctx>& arg) →  decltype(auto) constexpr
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 Context = scan_context, typename... Args>
auto scn::make_scan_args() constexpr

Constructs a scan_arg_store object, associated with Context, that contains value-initialized values of types Args....

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

Constructs a scan_arg_store object, associated with Context, that contains values.

template <typename Visitor, typename Ctx>
decltype(auto) scn::visit_scan_arg(Visitor&& vis, basic_scan_arg<Ctx>& arg) constexpr

Returns vis(x), where x is either a reference to the value contained in arg, or a basic_scan_arg::handle.

Visit a basic_scan_arg with Visitor. Calls vis with the value stored in arg. If no value is contained in arg, calls vis with a monostate.