scnlib  0.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
scan.h File Reference
#include "vscan.h"
#include <vector>

Go to the source code of this file.

Classes

struct  scn::detail::scan_result_for_range< Range, E >
 
struct  scn::detail::ignore_iterator< CharT >
 
struct  scn::detail::ignore_iterator_n< CharT >
 
struct  scn::discard_type< T >
 
struct  scn::scanner< CharT, discard_type< T > >
 

Namespaces

 scn
 
 scn::detail
 

Typedefs

template<typename Range , typename E = result<ptrdiff_t>>
using scn::detail::scan_result_for_range_t = typename scan_result_for_range< Range, E >::type
 

Functions

template<typename Range , typename Format , typename... Args>
auto scn::scan (Range &&r, const Format &f, Args &...a) -> detail::scan_result_for_range_t< Range >
 The most fundamental part of the scanning API. More...
 
template<typename Locale , typename Range , typename Format , typename... Args>
auto scn::scan_localized (const Locale &loc, Range &&r, const Format &f, Args &...a) -> detail::scan_result_for_range_t< Range >
 Read from the range in r using the locale in loc. More...
 
template<typename Range , typename... Args>
auto scn::scan (Range &&r, detail::default_t, Args &...a) -> detail::scan_result_for_range_t< Range >
 Equivalent to scan, but with a format string with the appropriate amount of space-separated "{}"s for the number of arguments. More...
 
template<typename T , typename Range >
auto scn::scan_value (Range &&r) -> detail::scan_result_for_range_t< Range, expected< T >>
 Scans a single value with the default options, returning it instead of using an output parameter. More...
 
template<typename Range , typename Format , typename... Args>
auto scn::scanf (Range &&r, const Format &f, Args &...a) -> detail::scan_result_for_range_t< Range >
 Otherwise equivalent to scan, except it uses scanf-like format string syntax, instead of the Python-like default one. More...
 
template<typename Format , typename... Args, typename CharT = detail::ranges::range_value_t<Format>>
auto scn::input (const Format &f, Args &...a) -> detail::scan_result_for_range_t< decltype(stdin_range< CharT >())>
 Otherwise equivalent to scan, expect reads from stdin. More...
 
template<typename Format , typename... Args, typename CharT = detail::ranges::range_value_t<Format>>
auto scn::prompt (const CharT *p, const Format &f, Args &...a) -> detail::scan_result_for_range_t< decltype(stdin_range< CharT >())>
 Equivalent to input, except writes what's in p to stdout. More...
 
template<typename T , typename CharT >
expected< const CharT * > scn::parse_integer (basic_string_view< CharT > str, T &val, int base=10)
 Parses an integer into val in base base from str. More...
 
template<typename WrappedRange , typename String , typename CharT >
auto scn::detail::getline_impl (WrappedRange &r, String &str, CharT until) -> detail::scan_result_for_range_t< WrappedRange, wrapped_error >
 
template<typename WrappedRange , typename CharT >
auto scn::detail::getline_impl (WrappedRange &r, basic_string_view< CharT > &str, CharT until) -> detail::scan_result_for_range_t< WrappedRange, wrapped_error >
 
template<typename Range , typename String , typename CharT >
auto scn::getline (Range &&r, String &str, CharT until) -> decltype(detail::getline_impl(std::declval< decltype(detail::wrap(std::forward< Range >(r)))& >(), str, until))
 Read the range in r into str until until is found. More...
 
template<typename Range , typename String , typename CharT = typename detail::extract_char_type<detail::ranges::iterator_t< detail::range_wrapper_for_t<Range>>>::type>
auto scn::getline (Range &&r, String &str) -> decltype(getline(std::forward< Range >(r), str, detail::ascii_widen< CharT >('\n')))
 Equivalent to getline with the last parameter set to '\n' with the appropriate character type. More...
 
template<typename WrappedRange , typename CharT = typename detail::extract_char_type< detail::range_wrapper_for_t< typename WrappedRange::iterator>>::type>
auto scn::detail::ignore_until_impl (WrappedRange &r, CharT until) -> scan_result< WrappedRange, wrapped_error >
 
template<typename WrappedRange , typename CharT = typename detail::extract_char_type< detail::range_wrapper_for_t< typename WrappedRange::iterator>>::type>
auto scn::detail::ignore_until_n_impl (WrappedRange &r, ranges::range_difference_t< WrappedRange > n, CharT until) -> scan_result< WrappedRange, wrapped_error >
 
template<typename Range , typename CharT >
auto scn::ignore_until (Range &&r, CharT until) -> decltype(detail::ignore_until_impl(std::declval< decltype(detail::wrap(std::forward< Range >(r)))& >(), until))
 Advances the beginning of r until until is found. More...
 
template<typename Range , typename CharT >
auto scn::ignore_until_n (Range &&r, detail::ranges::range_difference_t< Range > n, CharT until) -> decltype(detail::ignore_until_n_impl(std::declval< decltype(detail::wrap(std::forward< Range >(r)))& >(), n, until))
 Advances the beginning of r until until is found, or the beginning has been advanced n times. More...
 
template<typename Range , typename Container , typename CharT >
auto scn::scan_list (Range &&r, Container &c, CharT separator) -> detail::scan_result_for_range_t< Range, wrapped_error >
 Reads values repeatedly from r and writes them into c. More...
 
template<typename T >
discard_type< T > & scn::discard ()
 Scans an instance of T, but doesn't store it anywhere. More...