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"
20
21#include "version.h"
22#include <daw/cpp_17.h>
23#include <daw/daw_attributes.h>
24#include <daw/daw_likely.h>
25#include <daw/daw_traits.h>
26
27#include <cassert>
28#include <ciso646>
29#include <cstddef>
30#include <iterator>
31#include <type_traits>
32
33namespace daw::json {
34 inline namespace DAW_JSON_VER {
35 /***
36 * Handles the bounds and policy items for parsing execution and comments.
37 * @tparam PolicyFlags set via parse_options method to change compile time
38 * parser options
39 * @tparam Allocator An optional Allocator to allow for passing to objects
40 * created while parsing if they support the Allocator protocol of either
41 * the Allocator argument being last or with a first argument of
42 * std::allocator_arg_t followed by the allocator.`Thing( args..., alloc )`
43 * or `Thing( std::allocator_arg, alloc, args... )`
44 */
45 template<json_details::json_options_t PolicyFlags =
47 typename Allocator = json_details::NoAllocator>
48 struct BasicParsePolicy : json_details::AllocatorWrapper<Allocator> {
49 /***
50 * Allow temporarily setting a sentinel in the buffer to reduce range
51 * checking costs
52 */
53 static constexpr bool allow_temporarily_mutating_buffer =
54 json_details::get_bits_for<TemporarilyMutateBuffer>( PolicyFlags ) ==
56
57 using CharT =
58 std::conditional_t<allow_temporarily_mutating_buffer, char, char const>;
59 using iterator = CharT *;
60
61 /***
62 * see CheckedParseMode
63 */
64 static constexpr bool is_unchecked_input =
65 json_details::get_bits_for<CheckedParseMode>( PolicyFlags ) ==
67
68 /***
69 * See ExecModeTypes
70 */
71 using exec_tag_t =
72 switch_t<json_details::get_bits_for<ExecModeTypes, std::size_t>(
73 PolicyFlags ),
75
76 static constexpr exec_tag_t exec_tag = exec_tag_t{ };
77
78 /***
79 * see AllowEscapedNames
80 */
81 static constexpr bool allow_escaped_names =
82 json_details::get_bits_for<AllowEscapedNames>( PolicyFlags ) ==
84
85 /***
86 * see ForceFullNameCheck
87 */
88 static constexpr bool force_name_equal_check =
89 json_details::get_bits_for<ForceFullNameCheck>( PolicyFlags ) ==
91
92 /***
93 * see ZeroTerminatedString
94 */
95 static constexpr bool is_zero_terminated_string =
96 json_details::get_bits_for<ZeroTerminatedString>( PolicyFlags ) ==
98
99 /***
100 * See IEEE754Precise
101 */
102 static constexpr bool precise_ieee754 =
103 json_details::get_bits_for<IEEE754Precise>( PolicyFlags ) ==
105
106 /***
107 * See MinifiedDocument
108 */
109 static constexpr bool minified_document =
110 json_details::get_bits_for<MinifiedDocument>( PolicyFlags ) ==
112
113 /***
114 * See ExcludeSpecialEscapes
115 */
116 static constexpr bool exclude_special_escapes =
117 json_details::get_bits_for<ExcludeSpecialEscapes>( PolicyFlags ) ==
119
120 static constexpr bool allow_leading_zero_plus = true;
121
124 PolicyFlags, CheckedParseMode::no ),
125 Allocator>;
128 PolicyFlags, CheckedParseMode::yes ),
129 Allocator>;
130
131 static constexpr bool use_exact_mappings_by_default =
132 json_details::get_bits_for<UseExactMappingsByDefault>( PolicyFlags ) ==
134
135 static constexpr bool must_verify_end_of_data_is_valid =
136 json_details::get_bits_for<MustVerifyEndOfDataIsValid>( PolicyFlags ) ==
138
139 static constexpr bool expect_long_strings =
140 json_details::get_bits_for<ExpectLongStrings>( PolicyFlags ) ==
142
144 switch_t<json_details::get_bits_for<PolicyCommentTypes, std::size_t>(
145 PolicyFlags ),
148
153 std::size_t counter = 0;
155
156 template<auto... PolicyOptions>
158 json_details::set_bits( PolicyFlags, PolicyOptions... ), Allocator>;
159
160 inline constexpr BasicParsePolicy( ) = default;
161
162 inline constexpr BasicParsePolicy( iterator f, iterator l )
163 : first( f )
164 , last( l )
165 , class_first( f )
166 , class_last( l ) {}
167
168 inline constexpr BasicParsePolicy( iterator f, iterator l,
169 Allocator &alloc )
170 : json_details::AllocatorWrapper<Allocator>( alloc )
171 , first( f )
172 , last( l )
173 , class_first( f )
174 , class_last( l ) {}
175
176 inline constexpr BasicParsePolicy( iterator f, iterator l, iterator cf,
177 iterator cl )
178 : first( f )
179 , last( l )
180 , class_first( cf )
181 , class_last( cl ) {}
182
183 inline constexpr BasicParsePolicy( iterator f, iterator l, iterator cf,
184 iterator cl, Allocator &alloc )
185 : json_details::AllocatorWrapper<Allocator>( alloc )
186 , first( f )
187 , last( l )
188 , class_first( cf )
189 , class_last( cl ) {}
190
191 [[nodiscard]] inline constexpr BasicParsePolicy
193 iterator cf = iterator{ }, iterator cl = iterator{ } ) const {
194 BasicParsePolicy result = *this;
195 if( f ) {
196 result.first = f;
197 }
198 if( l ) {
199 result.last = l;
200 }
201 if( cf ) {
202 result.class_first = cf;
203 }
204 if( cl ) {
205 result.class_last = cl;
206 }
207 return result;
208 }
209
210 template<typename Alloc>
212
213 template<typename Alloc>
214 [[nodiscard]] static inline constexpr with_allocator_type<Alloc>
216 Alloc &alloc ) {
217 return with_allocator_type<Alloc>{ f, l, cf, cl, alloc };
218 }
219
220 template<typename Alloc>
221 [[nodiscard]] constexpr auto
223 if constexpr( std::is_same<Alloc, json_details::NoAllocator>::value ) {
224 return *this;
225 } else {
227 p.get_allocator( ) );
228 result.counter = p.counter;
229 return result;
230 }
231 }
232
233 template<typename Alloc>
234 [[nodiscard]] inline constexpr with_allocator_type<Alloc>
235 with_allocator( Alloc &alloc ) const {
236 auto result =
238 result.counter = counter;
239 return result;
240 }
241
244
245 [[nodiscard]] static inline constexpr without_allocator_type
247 auto result = without_allocator_type( p.first, p.last, p.class_first,
248 p.class_last );
249 result.counter = p.counter;
250 return result;
251 }
252
253 [[nodiscard]] inline constexpr without_allocator_type
255 auto result =
257 result.counter = counter;
258 return result;
259 }
260
261 template<typename Alloc>
262 [[nodiscard]] static inline constexpr with_allocator_type<Alloc>
263 with_allocator( iterator f, iterator l, Alloc &alloc ) {
264 return { f, l, f, l, alloc };
265 }
266
267 [[nodiscard]] static inline constexpr without_allocator_type
269 return { f, l };
270 }
271
272 [[nodiscard]] static inline constexpr without_allocator_type
274 return { f, l, cf, cl };
275 }
276
277 [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr iterator
278 data( ) const {
279 return first;
280 }
281
282 [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr iterator
283 data_end( ) const {
284 return last;
285 }
286
287 [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr iterator
288 begin( ) const {
289 return first;
290 }
291
292 [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr iterator
293 end( ) const {
294 return last;
295 }
296
297 [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr bool empty( ) const {
298 if( not first ) {
299 return true;
300 }
301 if constexpr( is_zero_terminated_string ) {
302 return first >= last or *first == '\0';
303 } else {
304 return first >= last;
305 }
306 }
307
308 [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr bool
309 has_more( ) const {
310 return first < last;
311 }
312
313 template<std::size_t N>
314 inline constexpr bool starts_with( char const ( &rhs )[N] ) const {
315 if( size( ) < ( N - 1 ) ) {
316 return false;
317 }
318 bool result = true;
319 for( std::size_t n = 0; n < ( N - 1 ); ++n ) {
320 result = result & ( first[n] == rhs[n] );
321 }
322 return result;
323 }
324
325 template<char c>
326 DAW_ATTRIB_FLATINLINE inline constexpr void move_to_next_of_unchecked( ) {
327 first =
328 json_details::memchr_unchecked<c, exec_tag_t, expect_long_strings>(
329 first, last );
330 }
331
332 template<char c>
333 DAW_ATTRIB_FLATINLINE inline constexpr void move_to_next_of_checked( ) {
334 first =
335 json_details::memchr_checked<c, exec_tag_t, expect_long_strings>(
336 first, last );
337 }
338
339 template<char c>
340 DAW_ATTRIB_FLATINLINE inline constexpr void move_to_next_of( ) {
341 if( is_unchecked_input ) {
342 move_to_next_of_unchecked<c>( );
343 } else {
344 move_to_next_of_checked<c>( );
345 }
346 }
347
348 [[nodiscard]] DAW_ATTRIB_INLINE inline constexpr char front( ) const {
349 return *first;
350 }
351
352 [[nodiscard]] DAW_ATTRIB_INLINE inline constexpr char
353 front_checked( ) const {
354 daw_json_assert( first < last, ErrorReason::UnexpectedEndOfData,
355 *this );
356 return *first;
357 }
358
359 [[nodiscard]] DAW_ATTRIB_INLINE inline constexpr std::size_t
360 size( ) const {
361 return static_cast<std::size_t>( last - first );
362 }
363
364 [[nodiscard]] inline constexpr bool is_null( ) const {
365 return first == nullptr;
366 }
367
368 DAW_ATTRIB_INLINE inline constexpr void remove_prefix( ) {
369 ++first;
370 }
371
372 DAW_ATTRIB_INLINE inline constexpr void remove_prefix( std::size_t n ) {
373 first += static_cast<std::ptrdiff_t>( n );
374 }
375
376 inline constexpr void set_class_position( ) {
379 }
380
381 struct class_pos_t {
384 };
385
386 inline constexpr void set_class_position( class_pos_t new_pos ) {
387 class_first = new_pos.f;
388 class_last = new_pos.l;
389 }
390
391 [[nodiscard]] inline constexpr class_pos_t get_class_position( ) const {
392 return { class_first, class_last };
393 }
394
395 inline constexpr void trim_left_checked( ) {
396 return CommentPolicy::trim_left_checked( *this );
397 }
398
399 inline constexpr void trim_left_unchecked( ) {
400 return CommentPolicy::trim_left_unchecked( *this );
401 }
402
403 inline constexpr void move_to_end_of_literal( ) {
404 CharT *f = first;
405 CharT *const l = last;
406 if constexpr( is_unchecked_input ) {
407 while( ( static_cast<unsigned char>( *f ) > 0x20U ) &
408 not CommentPolicy::is_literal_end( *f ) ) {
409 ++f;
410 }
411 } else {
412 while( ( f < l ) and ( ( static_cast<unsigned char>( *f ) > 0x20 ) &
413 not CommentPolicy::is_literal_end( *f ) ) ) {
414 ++f;
415 }
416 }
417 first = f;
418 }
419
420 [[nodiscard]] inline constexpr bool is_literal_end( ) const {
421 return CommentPolicy::is_literal_end( *first );
422 }
423
424 DAW_ATTRIB_INLINE [[nodiscard]] inline constexpr bool
426 daw_json_assert_weak( has_more( ), ErrorReason::UnexpectedEndOfData,
427 *this );
428 return ( static_cast<unsigned>( static_cast<unsigned char>( *first ) ) -
429 1U ) <= 0x1FU;
430 }
431
432 DAW_ATTRIB_INLINE [[nodiscard]] inline constexpr bool
434 return ( static_cast<unsigned>( static_cast<unsigned char>( *first ) ) -
435 1U ) <= 0x1FU;
436 }
437
438 [[nodiscard]] inline constexpr bool is_opening_bracket_checked( ) const {
439 return DAW_LIKELY( first < last ) and *first == '[';
440 }
441
442 [[nodiscard]] inline constexpr bool is_opening_brace_checked( ) const {
443 return DAW_LIKELY( first < last ) and *first == '{';
444 }
445
446 [[nodiscard]] inline constexpr bool is_closing_brace_checked( ) const {
447 return DAW_LIKELY( first < last ) and *first == '}';
448 }
449
450 [[nodiscard]] inline constexpr bool is_quotes_checked( ) const {
451 return DAW_LIKELY( first < last ) and *first == '"';
452 }
453
454 inline constexpr void trim_left( ) {
455 if constexpr( is_unchecked_input ) {
457 } else {
459 }
460 }
461
462 inline constexpr void move_next_member_or_end_unchecked( ) {
464 if( *first == ',' ) {
465 ++first;
467 }
468 }
469
470 DAW_ATTRIB_FLATINLINE inline constexpr void
473 if constexpr( is_zero_terminated_string ) {
474 if( *first == ',' ) {
475 ++first;
476 trim_left( );
477 }
478 } else {
479 if( DAW_LIKELY( first < last ) and *first == ',' ) {
480 ++first;
481 trim_left( );
482 }
483 }
484 }
485
486 DAW_ATTRIB_FLATINLINE inline constexpr void move_next_member_or_end( ) {
487 if constexpr( is_unchecked_input ) {
489 } else {
491 }
492 }
493
494 DAW_ATTRIB_FLATINLINE inline constexpr void move_next_member( ) {
495 if constexpr( is_unchecked_input ) {
496 CommentPolicy::move_next_member_unchecked( *this );
497 } else {
498 // We have no guarantee that all members are available
500 }
501 }
502
503 inline constexpr void move_to_next_class_member( ) {
504 CommentPolicy::template move_to_next_of<'"', '}'>( *this );
505 }
506
507 [[nodiscard]] inline constexpr bool is_at_next_class_member( ) const {
508 return parse_policy_details::in<'"', '}'>( *first );
509 }
510
511 [[nodiscard]] inline constexpr bool is_at_next_array_element( ) const {
512 return parse_policy_details::in<',', ']'>( *first );
513 }
514
515 [[nodiscard]] inline constexpr bool is_at_token_after_value( ) const {
516 return parse_policy_details::in<',', '}', ']'>( *first );
517 }
518
519 template<char PrimLeft, char PrimRight, char SecLeft, char SecRight>
520 [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr ParseState
522 return CommentPolicy::template skip_bracketed_item_checked<
523 PrimLeft, PrimRight, SecLeft, SecRight>( *this );
524 }
525
526 template<char PrimLeft, char PrimRight, char SecLeft, char SecRight>
527 [[nodiscard]] DAW_ATTRIB_FLATINLINE inline constexpr ParseState
529 return CommentPolicy::template skip_bracketed_item_unchecked<
530 PrimLeft, PrimRight, SecLeft, SecRight>( *this );
531 }
532
533 [[nodiscard]] inline constexpr ParseState skip_class( ) {
534 if constexpr( is_unchecked_input ) {
535 return skip_bracketed_item_unchecked<'{', '}', '[', ']'>( );
536 } else {
537 return skip_bracketed_item_checked<'{', '}', '[', ']'>( );
538 }
539 }
540
541 [[nodiscard]] inline constexpr ParseState skip_array( ) {
542 if constexpr( is_unchecked_input ) {
543 return skip_bracketed_item_unchecked<'[', ']', '{', '}'>( );
544 } else {
545 return skip_bracketed_item_checked<'[', ']', '{', '}'>( );
546 }
547 }
548 };
549
552
555
558
561
562 namespace json_details {
563 template<typename>
565
566 template<>
568 static inline constexpr ExecModeTypes value =
570 };
571
572 template<>
574 static inline constexpr ExecModeTypes value = ExecModeTypes::runtime;
575 };
576
577 template<>
579 static inline constexpr ExecModeTypes value = ExecModeTypes::simd;
580 };
581
582 template<typename ExecMode>
585 } // namespace json_details
586
587 template<typename ExecTag, typename Allocator = json_details::NoAllocator>
589 parse_options( json_details::exec_mode_from_tag<ExecTag> ), Allocator>;
590
592 runtime_exec_tag>::exec_tag_t::always_rvo );
593
594 template<typename ExecTag, typename Allocator = json_details::NoAllocator>
598 json_details::exec_mode_from_tag<ExecTag> ),
599 Allocator>;
600
603
606
607 template<typename ExecTag, typename Allocator = json_details::NoAllocator>
611 json_details::exec_mode_from_tag<ExecTag> ),
612 Allocator>;
613
614 template<typename ExecTag, typename Allocator = json_details::NoAllocator>
618 json_details::exec_mode_from_tag<ExecTag> ),
619 Allocator>;
620
623
626
627 /***
628 * Parse using SIMD instructions if available, allow C++ comments and fully
629 * check input
630 */
631
632 template<typename ExecTag, typename Allocator = json_details::NoAllocator>
636 json_details::exec_mode_from_tag<ExecTag> ),
637 Allocator>;
638
639 /***
640 * Parse using SIMD instructions if available, allow C++ comments and do not
641 * do more than minimum checking
642 */
643 template<typename ExecTag, typename Allocator = json_details::NoAllocator>
647 json_details::exec_mode_from_tag<ExecTag> ),
648 Allocator>;
649
653 } // namespace DAW_JSON_VER
654} // 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:190
#define daw_json_assert(Bool,...)
Definition: daw_json_assert.h:179
constexpr json_options_t set_bits(JsonOptionList< OptionList... >, json_options_t value, Option pol, Options... pols)
Definition: daw_json_option_bits.h:138
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:300
constexpr ExecModeTypes exec_mode_from_tag
Definition: daw_json_parse_policy.h:583
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:325
ExecModeTypes
Definition: daw_json_parse_options.h:33
Definition: daw_from_json.h:22
Definition: daw_json_parse_policy.h:381
CharT * l
Definition: daw_json_parse_policy.h:383
CharT * f
Definition: daw_json_parse_policy.h:382
Definition: daw_json_parse_policy.h:48
constexpr BasicParsePolicy(iterator f, iterator l, Allocator &alloc)
Definition: daw_json_parse_policy.h:168
constexpr void set_class_position(class_pos_t new_pos)
Definition: daw_json_parse_policy.h:386
BasicParsePolicy ParseState
Definition: daw_json_parse_policy.h:154
constexpr DAW_ATTRIB_FLATINLINE iterator begin() const
Definition: daw_json_parse_policy.h:288
constexpr DAW_ATTRIB_FLATINLINE void move_next_member_or_end()
Definition: daw_json_parse_policy.h:486
constexpr bool is_literal_end() const
Definition: daw_json_parse_policy.h:420
static constexpr without_allocator_type without_allocator(iterator f, iterator l, iterator cf, iterator cl)
Definition: daw_json_parse_policy.h:273
static constexpr bool allow_leading_zero_plus
Definition: daw_json_parse_policy.h:120
static constexpr bool exclude_special_escapes
Definition: daw_json_parse_policy.h:116
static constexpr bool is_zero_terminated_string
Definition: daw_json_parse_policy.h:95
constexpr void move_to_next_class_member()
Definition: daw_json_parse_policy.h:503
constexpr void trim_left_unchecked()
Definition: daw_json_parse_policy.h:399
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:74
constexpr DAW_ATTRIB_INLINE char front() const
Definition: daw_json_parse_policy.h:348
constexpr DAW_ATTRIB_FLATINLINE iterator data() const
Definition: daw_json_parse_policy.h:278
constexpr bool is_at_next_array_element() const
Definition: daw_json_parse_policy.h:511
static constexpr bool force_name_equal_check
Definition: daw_json_parse_policy.h:88
iterator first
Definition: daw_json_parse_policy.h:149
BasicParsePolicy< PolicyFlags, json_details::NoAllocator > without_allocator_type
Definition: daw_json_parse_policy.h:243
constexpr bool is_at_next_class_member() const
Definition: daw_json_parse_policy.h:507
static constexpr bool is_unchecked_input
Definition: daw_json_parse_policy.h:64
constexpr void trim_left_checked()
Definition: daw_json_parse_policy.h:395
static constexpr exec_tag_t exec_tag
Definition: daw_json_parse_policy.h:76
iterator class_first
Definition: daw_json_parse_policy.h:151
constexpr bool is_at_token_after_value() const
Definition: daw_json_parse_policy.h:515
constexpr ParseState skip_array()
Definition: daw_json_parse_policy.h:541
static constexpr bool minified_document
Definition: daw_json_parse_policy.h:109
constexpr ParseState skip_class()
Definition: daw_json_parse_policy.h:533
constexpr class_pos_t get_class_position() const
Definition: daw_json_parse_policy.h:391
constexpr DAW_ATTRIB_INLINE bool is_space_checked() const
Definition: daw_json_parse_policy.h:425
constexpr bool starts_with(char const (&rhs)[N]) const
Definition: daw_json_parse_policy.h:314
static constexpr bool must_verify_end_of_data_is_valid
Definition: daw_json_parse_policy.h:135
constexpr DAW_ATTRIB_FLATINLINE ParseState skip_bracketed_item_unchecked()
Definition: daw_json_parse_policy.h:528
constexpr with_allocator_type< Alloc > with_allocator(Alloc &alloc) const
Definition: daw_json_parse_policy.h:235
constexpr DAW_ATTRIB_FLATINLINE void move_next_member()
Definition: daw_json_parse_policy.h:494
constexpr DAW_ATTRIB_FLATINLINE void move_to_next_of()
Definition: daw_json_parse_policy.h:340
static constexpr bool precise_ieee754
Definition: daw_json_parse_policy.h:102
iterator last
Definition: daw_json_parse_policy.h:150
constexpr DAW_ATTRIB_FLATINLINE bool empty() const
Definition: daw_json_parse_policy.h:297
CharT * iterator
Definition: daw_json_parse_policy.h:59
constexpr DAW_ATTRIB_FLATINLINE void move_to_next_of_unchecked()
Definition: daw_json_parse_policy.h:326
constexpr bool is_opening_brace_checked() const
Definition: daw_json_parse_policy.h:442
constexpr auto with_allocator(BasicParsePolicy< PolicyFlags, Alloc > p) const
Definition: daw_json_parse_policy.h:222
iterator class_last
Definition: daw_json_parse_policy.h:152
static constexpr with_allocator_type< Alloc > with_allocator(iterator f, iterator l, iterator cf, iterator cl, Alloc &alloc)
Definition: daw_json_parse_policy.h:215
constexpr DAW_ATTRIB_INLINE void remove_prefix()
Definition: daw_json_parse_policy.h:368
constexpr void move_next_member_or_end_unchecked()
Definition: daw_json_parse_policy.h:462
constexpr DAW_ATTRIB_FLATINLINE ParseState skip_bracketed_item_checked()
Definition: daw_json_parse_policy.h:521
constexpr DAW_ATTRIB_FLATINLINE void move_to_next_of_checked()
Definition: daw_json_parse_policy.h:333
constexpr BasicParsePolicy(iterator f, iterator l, iterator cf, iterator cl, Allocator &alloc)
Definition: daw_json_parse_policy.h:183
std::size_t counter
Definition: daw_json_parse_policy.h:153
constexpr bool is_quotes_checked() const
Definition: daw_json_parse_policy.h:450
static constexpr without_allocator_type without_allocator(iterator f, iterator l)
Definition: daw_json_parse_policy.h:268
constexpr DAW_ATTRIB_FLATINLINE bool has_more() const
Definition: daw_json_parse_policy.h:309
static constexpr without_allocator_type without_allocator(BasicParsePolicy p)
Definition: daw_json_parse_policy.h:246
constexpr DAW_ATTRIB_FLATINLINE void move_next_member_or_end_checked()
Definition: daw_json_parse_policy.h:471
switch_t< json_details::get_bits_for< PolicyCommentTypes, std::size_t >(PolicyFlags), NoCommentSkippingPolicy, CppCommentSkippingPolicy, HashCommentSkippingPolicy > CommentPolicy
Definition: daw_json_parse_policy.h:147
constexpr void set_class_position()
Definition: daw_json_parse_policy.h:376
static constexpr bool allow_temporarily_mutating_buffer
Definition: daw_json_parse_policy.h:53
static constexpr bool expect_long_strings
Definition: daw_json_parse_policy.h:139
static constexpr bool allow_escaped_names
Definition: daw_json_parse_policy.h:81
constexpr BasicParsePolicy(iterator f, iterator l)
Definition: daw_json_parse_policy.h:162
std::conditional_t< allow_temporarily_mutating_buffer, char, char const > CharT
Definition: daw_json_parse_policy.h:58
constexpr bool is_null() const
Definition: daw_json_parse_policy.h:364
constexpr bool is_closing_brace_checked() const
Definition: daw_json_parse_policy.h:446
constexpr void move_to_end_of_literal()
Definition: daw_json_parse_policy.h:403
constexpr DAW_ATTRIB_INLINE char front_checked() const
Definition: daw_json_parse_policy.h:353
constexpr bool is_opening_bracket_checked() const
Definition: daw_json_parse_policy.h:438
constexpr DAW_ATTRIB_FLATINLINE iterator end() const
Definition: daw_json_parse_policy.h:293
constexpr BasicParsePolicy copy(iterator f=iterator{ }, iterator l=iterator{ }, iterator cf=iterator{ }, iterator cl=iterator{ }) const
Definition: daw_json_parse_policy.h:192
static constexpr with_allocator_type< Alloc > with_allocator(iterator f, iterator l, Alloc &alloc)
Definition: daw_json_parse_policy.h:263
static constexpr bool use_exact_mappings_by_default
Definition: daw_json_parse_policy.h:131
constexpr DAW_ATTRIB_INLINE bool is_space_unchecked() const
Definition: daw_json_parse_policy.h:433
constexpr DAW_ATTRIB_INLINE std::size_t size() const
Definition: daw_json_parse_policy.h:360
constexpr BasicParsePolicy(iterator f, iterator l, iterator cf, iterator cl)
Definition: daw_json_parse_policy.h:176
constexpr DAW_ATTRIB_INLINE void remove_prefix(std::size_t n)
Definition: daw_json_parse_policy.h:372
constexpr void trim_left()
Definition: daw_json_parse_policy.h:454
constexpr DAW_ATTRIB_FLATINLINE iterator data_end() const
Definition: daw_json_parse_policy.h:283
constexpr without_allocator_type without_allocator() const
Definition: daw_json_parse_policy.h:254
Definition: daw_json_parse_policy_no_comments.h:30
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
The version string used in namespace definitions. Must be a valid namespace name.
Definition: version.h:16