DAW JSON Link
daw_json_parse_policy.h
Go to the documentation of this file.
1 // Copyright (c) Darrell Wright
2 //
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
5 //
6 // Official repository: https://github.com/beached/daw_json_link
7 //
8 
9 #pragma once
10 
12 #include "daw_json_assert.h"
13 #include "daw_json_parse_common.h"
14 #include "daw_json_parse_options.h"
19 
20 #include "version.h"
21 #include <daw/cpp_17.h>
22 #include <daw/daw_attributes.h>
23 #include <daw/daw_likely.h>
24 #include <daw/daw_traits.h>
25 
26 #include <cassert>
27 #include <ciso646>
28 #include <cstddef>
29 #include <iterator>
30 #include <type_traits>
31 
32 namespace daw::json {
33  inline namespace DAW_JSON_VER {
34  /***
35  * Handles the bounds and policy items for parsing execution and comments.
36  * @tparam PolicyFlags set via parse_options method to change compile time
37  * parser options
38  * @tparam Allocator An optional Allocator to allow for passing to objects
39  * created while parsing if they support the Allocator protocol of either
40  * the Allocator argument being last or with a first argument of
41  * std::allocator_arg_t followed by the allocator.`Thing( args..., alloc )`
42  * or `Thing( std::allocator_arg, alloc, args... )`
43  */
44  template<json_details::json_options_t PolicyFlags =
46  typename Allocator = json_details::NoAllocator>
47  struct BasicParsePolicy : json_details::AllocatorWrapper<Allocator> {
48  /***
49  * Allow temporarily setting a sentinel in the buffer to reduce range
50  * checking costs
51  */
52  static constexpr bool allow_temporarily_mutating_buffer =
53  json_details::get_bits_for<TemporarilyMutateBuffer>( PolicyFlags ) ==
55 
56  using CharT =
57  std::conditional_t<allow_temporarily_mutating_buffer, char, char const>;
58  using iterator = CharT *;
59 
60  /***
61  * see CheckedParseMode
62  */
63  static constexpr bool is_unchecked_input =
64  json_details::get_bits_for<CheckedParseMode>( PolicyFlags ) ==
66 
67  /***
68  * See ExecModeTypes
69  */
70  using exec_tag_t =
71  switch_t<json_details::get_bits_for<ExecModeTypes, std::size_t>(
72  PolicyFlags ),
74 
75  static constexpr exec_tag_t exec_tag = exec_tag_t{ };
76 
77  /***
78  * see AllowEscapedNames
79  */
80  static constexpr bool allow_escaped_names =
81  json_details::get_bits_for<AllowEscapedNames>( PolicyFlags ) ==
83 
84  /***
85  * see ForceFullNameCheck
86  */
87  static constexpr bool force_name_equal_check =
88  json_details::get_bits_for<ForceFullNameCheck>( PolicyFlags ) ==
90 
91  /***
92  * see ZeroTerminatedString
93  */
94  static constexpr bool is_zero_terminated_string =
95  json_details::get_bits_for<ZeroTerminatedString>( PolicyFlags ) ==
97 
98  /***
99  * See IEEE754Precise
100  */
101  static constexpr bool precise_ieee754 =
102  json_details::get_bits_for<IEEE754Precise>( PolicyFlags ) ==
104 
105  /***
106  * See MinifiedDocument
107  */
108  static constexpr bool minified_document =
109  json_details::get_bits_for<MinifiedDocument>( PolicyFlags ) ==
111 
112  /***
113  * See ExcludeSpecialEscapes
114  */
115  static constexpr bool exclude_special_escapes =
116  json_details::get_bits_for<ExcludeSpecialEscapes>( PolicyFlags ) ==
118 
119  static constexpr bool allow_leading_zero_plus = true;
120 
121  using as_unchecked =
123  PolicyFlags, CheckedParseMode::no ),
124  Allocator>;
125  using as_checked =
127  PolicyFlags, CheckedParseMode::yes ),
128  Allocator>;
129 
130  static constexpr bool use_exact_mappings_by_default =
131  json_details::get_bits_for<UseExactMappingsByDefault>( PolicyFlags ) ==
133 
134  static constexpr bool must_verify_end_of_data_is_valid =
135  json_details::get_bits_for<MustVerifyEndOfDataIsValid>( PolicyFlags ) ==
137 
139  switch_t<json_details::get_bits_for<PolicyCommentTypes, std::size_t>(
140  PolicyFlags ),
143 
148  std::size_t counter = 0;
150 
151  template<auto... PolicyOptions>
153  json_details::set_bits( PolicyFlags, PolicyOptions... ), Allocator>;
154 
155  inline constexpr BasicParsePolicy( ) = default;
156 
157  inline constexpr BasicParsePolicy( iterator f, iterator l )
158  : first( f )
159  , last( l )
160  , class_first( f )
161  , class_last( l ) {}
162 
163  inline constexpr BasicParsePolicy( iterator f, iterator l,
164  Allocator &alloc )
165  : json_details::AllocatorWrapper<Allocator>( alloc )
166  , first( f )
167  , last( l )
168  , class_first( f )
169  , class_last( l ) {}
170 
171  inline constexpr BasicParsePolicy( iterator f, iterator l, iterator cf,
172  iterator cl )
173  : first( f )
174  , last( l )
175  , class_first( cf )
176  , class_last( cl ) {}
177 
178  inline constexpr BasicParsePolicy( iterator f, iterator l, iterator cf,
179  iterator cl, Allocator &alloc )
180  : json_details::AllocatorWrapper<Allocator>( alloc )
181  , first( f )
182  , last( l )
183  , class_first( cf )
184  , class_last( cl ) {}
185 
186  [[nodiscard]] inline constexpr BasicParsePolicy
188  iterator cf = iterator{ }, iterator cl = iterator{ } ) const {
189  BasicParsePolicy result = *this;
190  if( f ) {
191  result.first = f;
192  }
193  if( l ) {
194  result.last = l;
195  }
196  if( cf ) {
197  result.class_first = cf;
198  }
199  if( cl ) {
200  result.class_last = cl;
201  }
202  return result;
203  }
204 
205  template<typename Alloc>
207 
208  template<typename Alloc>
209  [[nodiscard]] static inline constexpr with_allocator_type<Alloc>
211  Alloc &alloc ) {
212  return with_allocator_type<Alloc>{ f, l, cf, cl, alloc };
213  }
214 
215  template<typename Alloc>
216  [[nodiscard]] constexpr auto
218  if constexpr( std::is_same<Alloc, json_details::NoAllocator>::value ) {
219  return *this;
220  } else {
221  auto result = with_allocator( first, last, class_first, class_last,
222  p.get_allocator( ) );
223  result.counter = p.counter;
224  return result;
225  }
226  }
227 
228  template<typename Alloc>
229  [[nodiscard]] inline constexpr with_allocator_type<Alloc>
230  with_allocator( Alloc &alloc ) const {
231  auto result =
233  result.counter = counter;
234  return result;
235  }
236 
239 
240  [[nodiscard]] static inline constexpr without_allocator_type
242  auto result = without_allocator_type( p.first, p.last, p.class_first,
243  p.class_last );
244  result.counter = p.counter;
245  return result;
246  }
247 
248  [[nodiscard]] inline constexpr without_allocator_type
249  without_allocator( ) const {
250  auto result =
252  result.counter = counter;
253  return result;
254  }
255 
256  template<typename Alloc>
257  [[nodiscard]] static inline constexpr with_allocator_type<Alloc>
258  with_allocator( iterator f, iterator l, Alloc &alloc ) {
259  return { f, l, f, l, alloc };
260  }
261 
262  [[nodiscard]] static inline constexpr without_allocator_type
264  return { f, l };
265  }
266 
267  [[nodiscard]] static inline constexpr without_allocator_type
269  return { f, l, cf, cl };
270  }
271 
272  [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr iterator
273  data( ) const {
274  return first;
275  }
276 
277  [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr iterator
278  data_end( ) const {
279  return last;
280  }
281 
282  [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr iterator
283  begin( ) const {
284  return first;
285  }
286 
287  [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr iterator
288  end( ) const {
289  return last;
290  }
291 
292  [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr bool empty( ) const {
293  if( not first ) {
294  return true;
295  }
296  if constexpr( is_zero_terminated_string ) {
297  return first >= last or *first == '\0';
298  } else {
299  return first >= last;
300  }
301  }
302 
303  [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr bool
304  has_more( ) const {
305  return first < last;
306  }
307 
308  template<std::size_t N>
309  inline constexpr bool starts_with( char const ( &rhs )[N] ) const {
310  if( size( ) < ( N - 1 ) ) {
311  return false;
312  }
313  bool result = true;
314  for( std::size_t n = 0; n < ( N - 1 ); ++n ) {
315  result = result & ( first[n] == rhs[n] );
316  }
317  return result;
318  }
319 
320  template<char c>
321  DAW_ATTRIB_FLATINLINE inline constexpr void move_to_next_of_unchecked( ) {
322 
323  if constexpr( traits::not_same_v<ParseState::exec_tag_t,
324  constexpr_exec_tag> ) {
325  first = reinterpret_cast<CharT *>( std::memchr(
326  first, c, static_cast<std::size_t>( class_last - first ) ) );
327  } else {
328  while( *first != c ) {
329  ++first;
330  }
331  }
332  }
333 
334  template<char c>
335  DAW_ATTRIB_FLATINLINE inline constexpr void move_to_next_of_checked( ) {
336 
337  if constexpr( traits::not_same_v<ParseState::exec_tag_t,
338  constexpr_exec_tag> ) {
339  first = reinterpret_cast<CharT *>( std::memchr(
340  first, c, static_cast<std::size_t>( class_last - first ) ) );
341  daw_json_assert( first != nullptr, json_details::missing_token( c ),
342  *this );
343  } else {
344  while( DAW_LIKELY( first < last ) and *first != c ) {
345  ++first;
346  }
347  }
348  }
349 
350  template<char c>
351  DAW_ATTRIB_FLATINLINE inline constexpr void move_to_next_of( ) {
352  if( is_unchecked_input ) {
353  move_to_next_of_unchecked<c>( );
354  } else {
355  move_to_next_of_checked<c>( );
356  }
357  }
358 
359  [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr char front( ) const {
360  return *first;
361  }
362 
363  [[nodiscard]] inline constexpr std::size_t size( ) const {
364  return static_cast<std::size_t>( last - first );
365  }
366 
367  [[nodiscard]] inline constexpr bool is_null( ) const {
368  return first == nullptr;
369  }
370 
371  DAW_ATTRIB_FLATINLINE inline constexpr void remove_prefix( ) {
372  ++first;
373  }
374 
375  DAW_ATTRIB_FLATINLINE inline constexpr void
376  remove_prefix( std::size_t n ) {
377  first += static_cast<std::ptrdiff_t>( n );
378  }
379 
380  inline constexpr void set_class_position( ) {
381  class_first = first;
382  class_last = last;
383  }
384 
385  inline constexpr void trim_left_checked( ) {
386  return CommentPolicy::trim_left_checked( *this );
387  }
388 
389  inline constexpr void trim_left_unchecked( ) {
390  return CommentPolicy::trim_left_unchecked( *this );
391  }
392 
393  inline constexpr void move_to_end_of_literal( ) {
394  CharT *f = first;
395  CharT *const l = last;
396  if constexpr( is_unchecked_input ) {
397  while( ( static_cast<unsigned char>( *f ) > 0x20U ) &
398  not CommentPolicy::is_literal_end( *f ) ) {
399  ++f;
400  }
401  } else {
402  while( ( f < l ) and ( ( static_cast<unsigned char>( *f ) > 0x20 ) &
403  not CommentPolicy::is_literal_end( *f ) ) ) {
404  ++f;
405  }
406  }
407  first = f;
408  }
409 
410  [[nodiscard]] inline constexpr bool is_literal_end( ) const {
411  return CommentPolicy::is_literal_end( *first );
412  }
413 
414  DAW_ATTRIB_FLATINLINE [[nodiscard]] inline constexpr bool
415  is_space_checked( ) const {
416  daw_json_assert_weak( has_more( ), ErrorReason::UnexpectedEndOfData,
417  *this );
418  return ( static_cast<unsigned>( static_cast<unsigned char>( *first ) ) -
419  1U ) <= 0x1FU;
420  }
421 
422  DAW_ATTRIB_FLATINLINE [[nodiscard]] inline constexpr bool
424  return ( static_cast<unsigned>( static_cast<unsigned char>( *first ) ) -
425  1U ) <= 0x1FU;
426  }
427 
428  [[nodiscard]] inline constexpr bool is_opening_bracket_checked( ) const {
429  return DAW_LIKELY( first < last ) and *first == '[';
430  }
431 
432  [[nodiscard]] inline constexpr bool is_opening_brace_checked( ) const {
433  return DAW_LIKELY( first < last ) and *first == '{';
434  }
435 
436  [[nodiscard]] inline constexpr bool is_closing_brace_checked( ) const {
437  return DAW_LIKELY( first < last ) and *first == '}';
438  }
439 
440  [[nodiscard]] inline constexpr bool is_quotes_checked( ) const {
441  return DAW_LIKELY( first < last ) and *first == '"';
442  }
443 
444  inline constexpr void trim_left( ) {
445  if constexpr( is_unchecked_input ) {
447  } else {
449  }
450  }
451 
452  inline constexpr void move_next_member_or_end_unchecked( ) {
454  if( *first == ',' ) {
455  ++first;
457  }
458  }
459 
460  DAW_ATTRIB_FLATINLINE inline constexpr void
463  if constexpr( is_zero_terminated_string ) {
464  if( *first == ',' ) {
465  ++first;
466  trim_left( );
467  }
468  } else {
469  if( DAW_LIKELY( first < last ) and *first == ',' ) {
470  ++first;
471  trim_left( );
472  }
473  }
474  }
475 
476  DAW_ATTRIB_FLATINLINE inline constexpr void move_next_member_or_end( ) {
477  if constexpr( is_unchecked_input ) {
479  } else {
481  }
482  }
483 
484  DAW_ATTRIB_FLATINLINE inline constexpr void move_next_member( ) {
485  if constexpr( is_unchecked_input ) {
486  CommentPolicy::move_next_member_unchecked( *this );
487  } else {
488  // We have no guarantee that all members are available
490  }
491  }
492 
493  inline constexpr void move_to_next_class_member( ) {
494  CommentPolicy::template move_to_next_of<'"', '}'>( *this );
495  }
496 
497  [[nodiscard]] inline constexpr bool is_at_next_class_member( ) const {
498  return parse_policy_details::in<'"', '}'>( *first );
499  }
500 
501  [[nodiscard]] inline constexpr bool is_at_next_array_element( ) const {
502  return parse_policy_details::in<',', ']'>( *first );
503  }
504 
505  [[nodiscard]] inline constexpr bool is_at_token_after_value( ) const {
506  return parse_policy_details::in<',', '}', ']'>( *first );
507  }
508 
509  template<char PrimLeft, char PrimRight, char SecLeft, char SecRight>
510  [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr ParseState
512  return CommentPolicy::template skip_bracketed_item_checked<
513  PrimLeft, PrimRight, SecLeft, SecRight>( *this );
514  }
515 
516  template<char PrimLeft, char PrimRight, char SecLeft, char SecRight>
517  [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr ParseState
519  return CommentPolicy::template skip_bracketed_item_unchecked<
520  PrimLeft, PrimRight, SecLeft, SecRight>( *this );
521  }
522 
523  [[nodiscard]] inline constexpr ParseState skip_class( ) {
524  if constexpr( is_unchecked_input ) {
525  return skip_bracketed_item_unchecked<'{', '}', '[', ']'>( );
526  } else {
527  return skip_bracketed_item_checked<'{', '}', '[', ']'>( );
528  }
529  }
530 
531  [[nodiscard]] inline constexpr ParseState skip_array( ) {
532  if constexpr( is_unchecked_input ) {
533  return skip_bracketed_item_unchecked<'[', ']', '{', '}'>( );
534  } else {
535  return skip_bracketed_item_checked<'[', ']', '{', '}'>( );
536  }
537  }
538  };
539 
542 
545 
548 
551 
552  namespace json_details {
553  template<typename>
555 
556  template<>
558  static inline constexpr ExecModeTypes value =
560  };
561 
562  template<>
564  static inline constexpr ExecModeTypes value = ExecModeTypes::runtime;
565  };
566 
567  template<>
569  static inline constexpr ExecModeTypes value = ExecModeTypes::simd;
570  };
571 
572  template<typename ExecMode>
575  } // namespace json_details
576 
577  template<typename ExecTag, typename Allocator = json_details::NoAllocator>
579  parse_options( json_details::exec_mode_from_tag<ExecTag> ), Allocator>;
580 
581  static_assert( SIMDNoCommentSkippingPolicyChecked<
582  runtime_exec_tag>::exec_tag_t::always_rvo );
583 
584  template<typename ExecTag, typename Allocator = json_details::NoAllocator>
588  json_details::exec_mode_from_tag<ExecTag> ),
589  Allocator>;
590 
593 
596 
597  template<typename ExecTag, typename Allocator = json_details::NoAllocator>
601  json_details::exec_mode_from_tag<ExecTag> ),
602  Allocator>;
603 
604  template<typename ExecTag, typename Allocator = json_details::NoAllocator>
608  json_details::exec_mode_from_tag<ExecTag> ),
609  Allocator>;
610 
613 
616 
617  /***
618  * Parse using SIMD instructions if available, allow C++ comments and fully
619  * check input
620  */
621 
622  template<typename ExecTag, typename Allocator = json_details::NoAllocator>
626  json_details::exec_mode_from_tag<ExecTag> ),
627  Allocator>;
628 
629  /***
630  * Parse using SIMD instructions if available, allow C++ comments and do not
631  * do more than minimum checking
632  */
633  template<typename ExecTag, typename Allocator = json_details::NoAllocator>
637  json_details::exec_mode_from_tag<ExecTag> ),
638  Allocator>;
639 
644 
645  namespace json_details {
646  /***
647  * We are either not in a constexpr context or we have constexpr dtors.
648  * This is generally used so that we can call cleanup code after parsing
649  * the member
650  */
651  template<typename ParsePolicy>
652  inline constexpr bool is_guaranteed_rvo_v =
653  ParsePolicy::exec_tag_t::always_rvo;
654  } // namespace json_details
655  } // namespace DAW_JSON_VER
656 } // namespace daw::json
Definition: daw_json_parse_policy_cpp_comments.h:28
Definition: daw_json_parse_policy_hash_comments.h:28
#define daw_json_assert_weak(Bool,...)
Definition: daw_json_assert.h:189
#define daw_json_assert(Bool,...)
Definition: daw_json_assert.h:178
constexpr json_options_t set_bits(JsonOptionList< OptionList... >, json_options_t value, Option pol, Options... pols)
Definition: daw_json_option_bits.h:138
constexpr bool is_guaranteed_rvo_v
Definition: daw_json_parse_policy.h:652
std::uint32_t json_options_t
Definition: daw_json_option_bits.h:23
static constexpr json_options_t default_policy_flag
Definition: daw_json_parse_options.h:289
constexpr ExecModeTypes exec_mode_from_tag
Definition: daw_json_parse_policy.h:573
constexpr DAW_ATTRIB_FLATINLINE bool in(char c)
Definition: daw_json_parse_policy_policy_details.h:19
constexpr json_details::json_options_t parse_options(Policies... policies)
Definition: daw_json_parse_options.h:314
ExecModeTypes
Definition: daw_json_parse_options.h:33
Definition: daw_from_json.h:22
Definition: daw_json_parse_policy.h:47
constexpr BasicParsePolicy(iterator f, iterator l, Allocator &alloc)
Definition: daw_json_parse_policy.h:163
BasicParsePolicy ParseState
Definition: daw_json_parse_policy.h:149
constexpr DAW_ATTRIB_FLATINLINE iterator begin() const
Definition: daw_json_parse_policy.h:283
constexpr DAW_ATTRIB_FLATINLINE void move_next_member_or_end()
Definition: daw_json_parse_policy.h:476
constexpr bool is_literal_end() const
Definition: daw_json_parse_policy.h:410
static constexpr without_allocator_type without_allocator(iterator f, iterator l, iterator cf, iterator cl)
Definition: daw_json_parse_policy.h:268
static constexpr bool allow_leading_zero_plus
Definition: daw_json_parse_policy.h:119
static constexpr bool exclude_special_escapes
Definition: daw_json_parse_policy.h:115
static constexpr bool is_zero_terminated_string
Definition: daw_json_parse_policy.h:94
constexpr DAW_ATTRIB_FLATINLINE bool is_space_checked() const
Definition: daw_json_parse_policy.h:415
constexpr void move_to_next_class_member()
Definition: daw_json_parse_policy.h:493
constexpr void trim_left_unchecked()
Definition: daw_json_parse_policy.h:389
switch_t< json_details::get_bits_for< ExecModeTypes, std::size_t >(PolicyFlags), constexpr_exec_tag, runtime_exec_tag, simd_exec_tag > exec_tag_t
Definition: daw_json_parse_policy.h:73
constexpr DAW_ATTRIB_FLATINLINE iterator data() const
Definition: daw_json_parse_policy.h:273
constexpr bool is_at_next_array_element() const
Definition: daw_json_parse_policy.h:501
constexpr std::size_t size() const
Definition: daw_json_parse_policy.h:363
static constexpr bool force_name_equal_check
Definition: daw_json_parse_policy.h:87
constexpr with_allocator_type< Alloc > with_allocator(Alloc &alloc) const
Definition: daw_json_parse_policy.h:230
iterator first
Definition: daw_json_parse_policy.h:144
BasicParsePolicy< PolicyFlags, json_details::NoAllocator > without_allocator_type
Definition: daw_json_parse_policy.h:238
constexpr bool is_at_next_class_member() const
Definition: daw_json_parse_policy.h:497
static constexpr with_allocator_type< Alloc > with_allocator(iterator f, iterator l, Alloc &alloc)
Definition: daw_json_parse_policy.h:258
static constexpr bool is_unchecked_input
Definition: daw_json_parse_policy.h:63
constexpr void trim_left_checked()
Definition: daw_json_parse_policy.h:385
static constexpr exec_tag_t exec_tag
Definition: daw_json_parse_policy.h:75
iterator class_first
Definition: daw_json_parse_policy.h:146
constexpr bool is_at_token_after_value() const
Definition: daw_json_parse_policy.h:505
constexpr ParseState skip_array()
Definition: daw_json_parse_policy.h:531
static constexpr bool minified_document
Definition: daw_json_parse_policy.h:108
constexpr ParseState skip_class()
Definition: daw_json_parse_policy.h:523
constexpr bool starts_with(char const (&rhs)[N]) const
Definition: daw_json_parse_policy.h:309
static constexpr bool must_verify_end_of_data_is_valid
Definition: daw_json_parse_policy.h:134
constexpr DAW_ATTRIB_FLATINLINE ParseState skip_bracketed_item_unchecked()
Definition: daw_json_parse_policy.h:518
constexpr DAW_ATTRIB_FLATINLINE void move_next_member()
Definition: daw_json_parse_policy.h:484
constexpr DAW_ATTRIB_FLATINLINE void move_to_next_of()
Definition: daw_json_parse_policy.h:351
constexpr DAW_ATTRIB_FLATINLINE bool is_space_unchecked() const
Definition: daw_json_parse_policy.h:423
constexpr DAW_ATTRIB_FLATINLINE char front() const
Definition: daw_json_parse_policy.h:359
static constexpr bool precise_ieee754
Definition: daw_json_parse_policy.h:101
iterator last
Definition: daw_json_parse_policy.h:145
constexpr DAW_ATTRIB_FLATINLINE bool empty() const
Definition: daw_json_parse_policy.h:292
CharT * iterator
Definition: daw_json_parse_policy.h:58
constexpr DAW_ATTRIB_FLATINLINE void move_to_next_of_unchecked()
Definition: daw_json_parse_policy.h:321
constexpr bool is_opening_brace_checked() const
Definition: daw_json_parse_policy.h:432
constexpr auto with_allocator(BasicParsePolicy< PolicyFlags, Alloc > p) const
Definition: daw_json_parse_policy.h:217
iterator class_last
Definition: daw_json_parse_policy.h:147
constexpr void move_next_member_or_end_unchecked()
Definition: daw_json_parse_policy.h:452
constexpr DAW_ATTRIB_FLATINLINE ParseState skip_bracketed_item_checked()
Definition: daw_json_parse_policy.h:511
constexpr DAW_ATTRIB_FLATINLINE void move_to_next_of_checked()
Definition: daw_json_parse_policy.h:335
constexpr BasicParsePolicy(iterator f, iterator l, iterator cf, iterator cl, Allocator &alloc)
Definition: daw_json_parse_policy.h:178
std::size_t counter
Definition: daw_json_parse_policy.h:148
constexpr bool is_quotes_checked() const
Definition: daw_json_parse_policy.h:440
static constexpr without_allocator_type without_allocator(iterator f, iterator l)
Definition: daw_json_parse_policy.h:263
constexpr DAW_ATTRIB_FLATINLINE bool has_more() const
Definition: daw_json_parse_policy.h:304
static constexpr without_allocator_type without_allocator(BasicParsePolicy p)
Definition: daw_json_parse_policy.h:241
constexpr DAW_ATTRIB_FLATINLINE void remove_prefix(std::size_t n)
Definition: daw_json_parse_policy.h:376
constexpr DAW_ATTRIB_FLATINLINE void move_next_member_or_end_checked()
Definition: daw_json_parse_policy.h:461
switch_t< json_details::get_bits_for< PolicyCommentTypes, std::size_t >(PolicyFlags), NoCommentSkippingPolicy, CppCommentSkippingPolicy, HashCommentSkippingPolicy > CommentPolicy
Definition: daw_json_parse_policy.h:142
constexpr void set_class_position()
Definition: daw_json_parse_policy.h:380
static constexpr bool allow_temporarily_mutating_buffer
Definition: daw_json_parse_policy.h:52
static constexpr bool allow_escaped_names
Definition: daw_json_parse_policy.h:80
constexpr BasicParsePolicy(iterator f, iterator l)
Definition: daw_json_parse_policy.h:157
std::conditional_t< allow_temporarily_mutating_buffer, char, char const > CharT
Definition: daw_json_parse_policy.h:57
constexpr bool is_null() const
Definition: daw_json_parse_policy.h:367
constexpr bool is_closing_brace_checked() const
Definition: daw_json_parse_policy.h:436
constexpr void move_to_end_of_literal()
Definition: daw_json_parse_policy.h:393
constexpr bool is_opening_bracket_checked() const
Definition: daw_json_parse_policy.h:428
constexpr DAW_ATTRIB_FLATINLINE iterator end() const
Definition: daw_json_parse_policy.h:288
constexpr BasicParsePolicy copy(iterator f=iterator{ }, iterator l=iterator{ }, iterator cf=iterator{ }, iterator cl=iterator{ }) const
Definition: daw_json_parse_policy.h:187
static constexpr bool use_exact_mappings_by_default
Definition: daw_json_parse_policy.h:130
constexpr BasicParsePolicy(iterator f, iterator l, iterator cf, iterator cl)
Definition: daw_json_parse_policy.h:171
constexpr DAW_ATTRIB_FLATINLINE void remove_prefix()
Definition: daw_json_parse_policy.h:371
static constexpr with_allocator_type< Alloc > with_allocator(iterator f, iterator l, iterator cf, iterator cl, Alloc &alloc)
Definition: daw_json_parse_policy.h:210
constexpr void trim_left()
Definition: daw_json_parse_policy.h:444
constexpr DAW_ATTRIB_FLATINLINE iterator data_end() const
Definition: daw_json_parse_policy.h:278
constexpr without_allocator_type without_allocator() const
Definition: daw_json_parse_policy.h:249
Definition: daw_json_parse_policy_no_comments.h:29
Definition: daw_json_exec_modes.h:19
AllocatorWrapper(allocator_type &alloc) noexcept
Definition: daw_json_allocator_wrapper.h:56
Definition: daw_json_exec_modes.h:28
Definition: daw_json_exec_modes.h:41
#define DAW_JSON_VER
Definition: version.h:11