Localization module

Scanning APIs that allow passing in a locale.

Functions

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

Function documentation

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

scan using an explicit locale.

Has no effect on its own, locale-specific scanning still needs to be opted-into on an argument-by-argument basis, with the L format string specifier.

auto result = scn::scan<double>(
    std::locale{"fi_FI.UTF-8"}, "3,14, "{:L}");
// result->value() == 3.14

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

scan with a locale and default values

template <typename Source, typename Locale, typename = std::void_t<decltype(Locale::classic())>>
vscan_result<Source> vscan(const Locale& loc, Source&& source, std::string_view format, scan_args args)

Perform actual scanning from source, according to format, into the type-erased arguments at args, using loc, if requested. Called by scan.