scnlib  0.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vscan.h
Go to the documentation of this file.
1 // Copyright 2017-2019 Elias Kosunen
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // This file is a part of scnlib:
16 // https://github.com/eliaskosunen/scnlib
17 
18 #ifndef SCN_DETAIL_VSCAN_H
19 #define SCN_DETAIL_VSCAN_H
20 
21 #include "context.h"
22 #include "file.h"
23 #include "visitor.h"
24 
25 namespace scn {
27 
28  namespace detail {
29  struct default_t {
30  };
31  } // namespace detail
32  namespace {
33  constexpr auto& default_tag =
35  }
36 
45 
47  template <typename Context, typename ParseCtx>
49  ParseCtx& pctx,
51  {
52  return visit(ctx, pctx, args);
53  }
54 
55 #if !defined(SCN_HEADER_ONLY) || !SCN_HEADER_ONLY
56 
57 #define SCN_VSCAN_DECLARE(Range) \
58  scan_result_for_t<basic_context<detail::range_wrapper_for_t<Range>, \
59  basic_default_locale_ref<char>>> \
60  vscan(basic_context<detail::range_wrapper_for_t<Range>, \
61  basic_default_locale_ref<char>>&, \
62  basic_parse_context<basic_default_locale_ref<char>>&, \
63  basic_args<basic_context<detail::range_wrapper_for_t<Range>, \
64  basic_default_locale_ref<char>>>); \
65  \
66  scan_result_for_t<basic_context<detail::range_wrapper_for_t<Range>, \
67  basic_default_locale_ref<char>>> \
68  vscan(basic_context<detail::range_wrapper_for_t<Range>, \
69  basic_default_locale_ref<char>>&, \
70  basic_empty_parse_context<basic_default_locale_ref<char>>&, \
71  basic_args<basic_context<detail::range_wrapper_for_t<Range>, \
72  basic_default_locale_ref<char>>>);
73 
78 
79 #endif // !SCN_HEADER_ONLY
80 
82 
84 } // namespace scn
85 
86 #if defined(SCN_HEADER_ONLY) && SCN_HEADER_ONLY && !defined(SCN_VSCAN_CPP)
87 #include "vscan.cpp"
88 #endif
89 
90 #endif // SCN_DETAIL_VSCAN_H
basic_string_view< char > string_view
Definition: string_view.h:273
#define SCN_END_NAMESPACE
Definition: config.h:401
scan_result_for_t< Context > visit(Context &ctx, ParseCtx &pctx, basic_args< Context > args)
Definition: visitor.h:226
typename scan_result_for< Context >::type scan_result_for_t
Definition: visitor.h:206
#define SCN_BEGIN_NAMESPACE
Definition: config.h:400
#define SCN_VSCAN_DECLARE(Range)
Definition: vscan.h:57
scan_result_for_t< Context > vscan(Context &ctx, ParseCtx &pctx, basic_args< Context > args)
Definition: vscan.h:48
basic_file_view< char > file_view
Definition: file.h:459