scnlib  0.1.2
FormattedinputformodernC++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
scn::detail Namespace Reference

Namespaces

 is_std_streamablestd
 
 sto
 
 strto
 

Classes

struct  named_arg_base
 
struct  named_arg
 
struct  custom_value
 
struct  monostate
 
class  value
 
struct  init
 
struct  convert_to_int
 
class  arg_map
 
struct  get_type
 
struct  context_locale_base
 
struct  context_parse_context_base
 
struct  context_options_base
 
class  context_base
 
class  arg_context_base
 Scanning context. More...
 
struct  dummy_stream
 
struct  dummy_context
 
class  erased_stream_base
 
class  erased_sized_stream_base
 
class  erased_stream_impl
 
class  erased_sized_stream_impl
 
class  stream_std_streambuf
 
struct  test_std_stream
 
struct  is_std_streamable
 
class  truename_falsename_storage
 
struct  default_widen
 
struct  default_widen< char >
 
struct  default_widen< wchar_t >
 
struct  default_narrow
 
struct  default_narrow< char >
 
struct  default_narrow< wchar_t >
 
struct  locale_defaults
 
struct  locale_defaults< char >
 
struct  locale_defaults< wchar_t >
 
class  parse_context_base
 
class  basic_parse_context_base
 
struct  error_handler
 
class  small_vector_base
 
struct  basic_stack_storage
 
struct  basic_stack_storage< T, 0 >
 
struct  aligned_union
 
class  small_vector
 
struct  bidir_iterator_stream
 
struct  fwd_iterator_stream
 
struct  iterator_stream
 
struct  iterator_stream< Iterator, std::forward_iterator_tag >
 
struct  iterator_stream< Iterator, std::bidirectional_iterator_tag >
 
struct  iterator_stream< Iterator, std::random_access_iterator_tag >
 
struct  integer_sequence
 
struct  iseq_if_c_impl
 
struct  iseq_if_c_impl< true, T, E >
 
struct  iseq_if_c_impl< false, T, E >
 
struct  iseq_identity
 
struct  append_integer_sequence
 
struct  append_integer_sequence< integer_sequence< T, I...>, integer_sequence< T, J...> >
 
struct  make_integer_sequence_impl
 
struct  make_integer_sequence_impl_
 
struct  ignore_iterator
 
struct  make_void
 
struct  static_const
 
struct  priority_tag
 
struct  priority_tag< 0 >
 
class  unique_ptr
 
struct  array
 
class  erased_storage
 
struct  read_into_until_space_impl
 
struct  read_into_until_space_impl< Stream, basic_default_locale_ref< char >, Iterator, typename std::enable_if< std::is_same< typename Stream::char_type, char >::value &&is_sized_stream< Stream >::value >::type >
 
struct  char_scanner
 
struct  buffer_scanner
 
struct  bool_scanner
 
struct  float_scanner
 
class  integer_scanner
 
struct  string_scanner
 
struct  default_t
 

Typedefs

template<typename T >
using basic_stack_storage_type = typename std::aligned_storage< sizeof(T), alignof(T)>::type
 
template<bool C, typename T , typename E >
using iseq_if_c = typename iseq_if_c_impl< C, T, E >::type
 
template<typename T , T N>
using make_integer_sequence = typename detail::make_integer_sequence_impl< T, N >::type
 
template<std::size_t... I>
using index_sequence = integer_sequence< std::size_t, I...>
 
template<std::size_t N>
using make_index_sequence = make_integer_sequence< std::size_t, N >
 
template<typename... T>
using index_sequence_for = make_integer_sequence< std::size_t, sizeof...(T)>
 
template<typename... Ts>
using void_t = typename make_void< Ts...>::type
 

Enumerations

enum  type {
  none_type = 0, named_arg_type, short_type, int_type,
  long_type, long_long_type, ushort_type, uint_type,
  ulong_type, ulong_long_type, bool_type, char_type,
  last_integer_type = char_type, float_type, double_type, long_double_type,
  last_numeric_type = long_double_type, buffer_type, string_type, custom_type
}
 
enum  : size_t { max_packed_args = sizeof(size_t) * 8 / 5 }
 
enum  : size_t { is_unpacked_bit = size_t{1} << (sizeof(size_t) * 8 - 1) }
 

Functions

SCN_CONSTEXPR bool is_integral (type t) noexcept
 
SCN_CONSTEXPR bool is_arithmetic (type t) noexcept
 
template<typename Context , typename T >
error scan_custom_arg (void *arg, Context &ctx)
 
template<typename Context , typename T >
SCN_CONSTEXPR14 Context::arg_type make_arg (T &value)
 
template<typename C >
init< C, typename C::char_type,
char_type
make_value (typename C::char_type &val, priority_tag< 1 >)
 
template<typename C , typename T >
init< C, void *, named_arg_typemake_value (named_arg< T, typename C::char_type > &val, priority_tag< 1 >)
 
template<typename C , typename T >
auto make_value (T &val, priority_tag< 1 >) -> typename std::enable_if< std::is_enum< T >::value &&convert_to_int< T, typename C::char_type >::value, init< C, int, int_type >>::type
 
template<typename C , typename T >
auto make_value (T &val, priority_tag< 0 >) -> init< C, T, custom_type >
 
template<typename Context >
SCN_CONSTEXPR size_t get_types ()
 
template<typename Context , typename Arg , typename... Args>
SCN_CONSTEXPR size_t get_types ()
 
template<bool Packed, typename Context , typename T >
auto make_arg (T &v) -> typename std::enable_if< Packed, value< Context >>::type
 
SCN_CONSTEXPR bool has_zero (uint64_t v)
 
bool is_space (char ch) noexcept
 
SCN_CONSTEXPR bool is_space (wchar_t ch) noexcept
 
SCN_CONSTEXPR bool is_digit (char ch) noexcept
 
SCN_CONSTEXPR bool is_digit (wchar_t ch) noexcept
 
template<typename Iter >
std::reverse_iterator< Iter > make_reverse_iterator (Iter i)
 
template<typename T >
SCN_CONSTEXPRconstexpr_max (T val)
 
template<typename T , typename... Ts>
SCN_CONSTEXPRconstexpr_max (T val, Ts...a)
 
template<typename T , size_t N>
SCN_CONSTEXPR14 void swap (small_vector< T, N > &l, small_vector< T, N > &r) noexcept(noexcept(l.swap(r)))
 
size_t strlen (const char *s) noexcept
 
size_t strlen (const wchar_t *s) noexcept
 
int memcmp (const char *l, const char *r, size_t n) noexcept
 
int memcmp (const wchar_t *l, const wchar_t *r, size_t n) noexcept
 
template<typename Fn , typename... Args, typename std::enable_if< std::is_member_pointer< typename std::decay< Fn >::type >::value >::type * = nullptr, int = 0>
constexpr auto invoke (Fn &&f, Args &&...args) noexcept(noexcept(std::mem_fn(f)(std::forward< Args >(args)...))) -> decltype(std::mem_fn(f)(std::forward< Args >(args)...))
 
template<typename Fn , typename... Args, typename std::enable_if<!std::is_member_pointer< typename std::decay< Fn >::type >::value >::type * = nullptr>
constexpr auto invoke (Fn &&f, Args &&...args) noexcept(noexcept(std::forward< Fn >(f)(std::forward< Args >(args)...))) -> decltype(std::forward< Fn >(f)(std::forward< Args >(args)...))
 
template<class F , class Tuple , std::size_t... I>
constexpr auto apply_impl (F &&f, Tuple &&t, index_sequence< I...>) noexcept(noexcept(detail::invoke(std::forward< F >(f), std::get< I >(std::forward< Tuple >(t))...))) -> decltype(detail::invoke(std::forward< F >(f), std::get< I >(std::forward< Tuple >(t))...))
 
template<class F , class Tuple >
constexpr auto apply (F &&f, Tuple &&t) noexcept(noexcept(detail::apply_impl(std::forward< F >(f), std::forward< Tuple >(t), make_index_sequence< std::tuple_size< typename std::remove_reference< Tuple >::type >::value >{}))) -> decltype(detail::apply_impl(std::forward< F >(f), std::forward< Tuple >(t), make_index_sequence< std::tuple_size< typename std::remove_reference< Tuple >::type >::value >
 
template<typename CharT >
void swap (ignore_iterator< CharT > &a, ignore_iterator< CharT > &b)
 
template<typename Integral >
SCN_CONSTEXPR14 int _max_digits (int base) noexcept
 
template<typename Integral >
SCN_CONSTEXPR14 int max_digits (int base) noexcept
 
template<typename T >
SCN_CONSTEXPR T * launder (T *p) noexcept
 
template<typename CharT >
CharT ascii_widen (char ch)
 
template<>
SCN_CONSTEXPR char ascii_widen (char ch)
 
template<>
SCN_CONSTEXPR wchar_t ascii_widen (char ch)
 
template<typename T >
SCN_CONSTEXPRmax (T a, T b) noexcept
 
template<typename It >
SCN_CONSTEXPR14 It min_element (It first, It last)
 
template<typename T >
SCN_CONSTEXPRmin (T a, T b) noexcept
 
template<typename T >
SCN_CONSTEXPR14min (std::initializer_list< T > list) noexcept
 
template<typename ForwardIt , typename T >
ForwardIt remove (ForwardIt first, ForwardIt last, const T &value)
 
template<class InputIt , class T >
SCN_CONSTEXPR14 InputIt find (InputIt first, InputIt last, const T &value)
 
template<typename T , typename... Args>
SCN_CLANG_PUSH unique_ptr< T > make_unique (Args &&...a)
 

Typedef Documentation

template<typename T >
using scn::detail::basic_stack_storage_type = typedef typename std::aligned_storage<sizeof(T), alignof(T)>::type

Definition at line 144 of file small_vector.h.

template<std::size_t... I>
using scn::detail::index_sequence = typedef integer_sequence<std::size_t, I...>

Definition at line 129 of file tuple_return.h.

template<typename... T>
using scn::detail::index_sequence_for = typedef make_integer_sequence<std::size_t, sizeof...(T)>

Definition at line 138 of file tuple_return.h.

template<bool C, typename T , typename E >
using scn::detail::iseq_if_c = typedef typename iseq_if_c_impl<C, T, E>::type

Definition at line 74 of file tuple_return.h.

template<std::size_t N>
using scn::detail::make_index_sequence = typedef make_integer_sequence<std::size_t, N>

Definition at line 133 of file tuple_return.h.

template<typename T , T N>
using scn::detail::make_integer_sequence = typedef typename detail::make_integer_sequence_impl<T, N>::type

Definition at line 125 of file tuple_return.h.

template<typename... Ts>
using scn::detail::void_t = typedef typename make_void<Ts...>::type

Definition at line 42 of file util.h.

Enumeration Type Documentation

anonymous enum : size_t
Enumerator
max_packed_args 

Definition at line 279 of file args.h.

anonymous enum : size_t
Enumerator
is_unpacked_bit 

Definition at line 280 of file args.h.

Enumerator
none_type 
named_arg_type 
short_type 
int_type 
long_type 
long_long_type 
ushort_type 
uint_type 
ulong_type 
ulong_long_type 
bool_type 
char_type 
last_integer_type 
float_type 
double_type 
long_double_type 
last_numeric_type 
buffer_type 
string_type 
custom_type 

Definition at line 62 of file args.h.

Function Documentation

template<typename Integral >
SCN_CONSTEXPR14 int scn::detail::_max_digits ( int  base)
noexcept

Definition at line 60 of file util.h.

template<class F , class Tuple >
constexpr auto scn::detail::apply ( F &&  f,
Tuple &&  t 
) -> decltype(detail::apply_impl( std::forward<F>(f), std::forward<Tuple>(t), make_index_sequence<std::tuple_size< typename std::remove_reference<Tuple>::type>::value>
noexcept

Definition at line 154 of file tuple_return.h.

template<class F , class Tuple , std::size_t... I>
constexpr auto scn::detail::apply_impl ( F &&  f,
Tuple &&  t,
index_sequence< I...>   
) -> decltype(detail::invoke(std::forward<F>(f), std::get<I>(std::forward<Tuple>(t))...))
noexcept

Definition at line 143 of file tuple_return.h.

template<typename CharT >
CharT scn::detail::ascii_widen ( char  ch)

Definition at line 110 of file util.h.

template<>
SCN_CONSTEXPR char scn::detail::ascii_widen ( char  ch)

Definition at line 110 of file util.h.

template<>
SCN_CONSTEXPR wchar_t scn::detail::ascii_widen ( char  ch)

Definition at line 115 of file util.h.

template<typename T >
SCN_CONSTEXPR T scn::detail::constexpr_max ( val)

Definition at line 216 of file small_vector.h.

template<typename T , typename... Ts>
SCN_CONSTEXPR T scn::detail::constexpr_max ( val,
Ts...  a 
)

Definition at line 221 of file small_vector.h.

template<class InputIt , class T >
SCN_CONSTEXPR14 InputIt scn::detail::find ( InputIt  first,
InputIt  last,
const T &  value 
)

Definition at line 173 of file util.h.

template<typename Context >
SCN_CONSTEXPR size_t scn::detail::get_types ( )

Definition at line 491 of file args.h.

template<typename Context , typename Arg , typename... Args>
SCN_CONSTEXPR size_t scn::detail::get_types ( )

Definition at line 496 of file args.h.

SCN_CONSTEXPR bool scn::detail::has_zero ( uint64_t  v)

Definition at line 63 of file locale.h.

template<typename Fn , typename... Args, typename std::enable_if< std::is_member_pointer< typename std::decay< Fn >::type >::value >::type * = nullptr, int = 0>
constexpr auto scn::detail::invoke ( Fn &&  f,
Args &&...  args 
) -> decltype(std::mem_fn(f)(std::forward<Args>(args)...))
noexcept

Definition at line 36 of file tuple_return.h.

template<typename Fn , typename... Args, typename std::enable_if<!std::is_member_pointer< typename std::decay< Fn >::type >::value >::type * = nullptr>
constexpr auto scn::detail::invoke ( Fn &&  f,
Args &&...  args 
) -> decltype(std::forward<Fn>(f)(std::forward<Args>(args)...))
noexcept

Definition at line 47 of file tuple_return.h.

SCN_CONSTEXPR bool scn::detail::is_arithmetic ( type  t)
noexcept

Definition at line 95 of file args.h.

SCN_CONSTEXPR bool scn::detail::is_digit ( char  ch)
inlinenoexcept

Definition at line 109 of file locale.h.

SCN_CONSTEXPR bool scn::detail::is_digit ( wchar_t  ch)
inlinenoexcept

Definition at line 113 of file locale.h.

SCN_CONSTEXPR bool scn::detail::is_integral ( type  t)
noexcept

Definition at line 90 of file args.h.

bool scn::detail::is_space ( char  ch)
inlinenoexcept

Definition at line 70 of file locale.h.

SCN_CONSTEXPR bool scn::detail::is_space ( wchar_t  ch)
inlinenoexcept

Definition at line 104 of file locale.h.

template<typename T >
SCN_CONSTEXPR T* scn::detail::launder ( T *  p)
noexcept

Definition at line 98 of file util.h.

template<typename Context , typename T >
SCN_CONSTEXPR14 Context::arg_type scn::detail::make_arg ( T &  value)

Definition at line 503 of file args.h.

template<bool Packed, typename Context , typename T >
auto scn::detail::make_arg ( T &  v) -> typename std::enable_if<Packed, value<Context>>::type
inline

Definition at line 512 of file args.h.

template<typename Iter >
std::reverse_iterator<Iter> scn::detail::make_reverse_iterator ( Iter  i)

Definition at line 32 of file small_vector.h.

template<typename T , typename... Args>
SCN_CLANG_PUSH unique_ptr<T> scn::detail::make_unique ( Args &&...  a)

Definition at line 264 of file util.h.

template<typename C >
init<C, typename C::char_type, char_type> scn::detail::make_value ( typename C::char_type &  val,
priority_tag< 1 >   
)

Definition at line 239 of file args.h.

template<typename C , typename T >
init<C, void*, named_arg_type> scn::detail::make_value ( named_arg< T, typename C::char_type > &  val,
priority_tag< 1 >   
)

Definition at line 247 of file args.h.

template<typename C , typename T >
auto scn::detail::make_value ( T &  val,
priority_tag< 1 >   
) -> typename std::enable_if< std::is_enum<T>::value && convert_to_int<T, typename C::char_type>::value, init<C, int, int_type>>::type
inline

Definition at line 263 of file args.h.

template<typename C , typename T >
auto scn::detail::make_value ( T &  val,
priority_tag< 0 >   
) -> init<C, T, custom_type>
inline

Definition at line 273 of file args.h.

template<typename T >
SCN_CONSTEXPR T scn::detail::max ( a,
b 
)
noexcept

Definition at line 121 of file util.h.

template<typename Integral >
SCN_CONSTEXPR14 int scn::detail::max_digits ( int  base)
noexcept

Definition at line 86 of file util.h.

int scn::detail::memcmp ( const char *  l,
const char *  r,
size_t  n 
)
inlinenoexcept

Definition at line 41 of file string_view.h.

int scn::detail::memcmp ( const wchar_t *  l,
const wchar_t *  r,
size_t  n 
)
inlinenoexcept

Definition at line 45 of file string_view.h.

template<typename T >
SCN_CONSTEXPR T scn::detail::min ( a,
b 
)
noexcept

Definition at line 144 of file util.h.

template<typename T >
SCN_CONSTEXPR14 T scn::detail::min ( std::initializer_list< T >  list)
noexcept

Definition at line 149 of file util.h.

template<typename It >
SCN_CONSTEXPR14 It scn::detail::min_element ( It  first,
It  last 
)

Definition at line 127 of file util.h.

template<typename ForwardIt , typename T >
ForwardIt scn::detail::remove ( ForwardIt  first,
ForwardIt  last,
const T &  value 
)

Definition at line 155 of file util.h.

template<typename Context , typename T >
error scn::detail::scan_custom_arg ( void *  arg,
Context &  ctx 
)

Definition at line 110 of file args.h.

size_t scn::detail::strlen ( const char *  s)
inlinenoexcept

Definition at line 32 of file string_view.h.

size_t scn::detail::strlen ( const wchar_t *  s)
inlinenoexcept

Definition at line 36 of file string_view.h.

template<typename CharT >
void scn::detail::swap ( ignore_iterator< CharT > &  a,
ignore_iterator< CharT > &  b 
)

Definition at line 111 of file types.h.

template<typename T , size_t N>
SCN_CONSTEXPR14 void scn::detail::swap ( small_vector< T, N > &  l,
small_vector< T, N > &  r 
)
noexcept

Definition at line 851 of file small_vector.h.