DAW JSON Link
Loading...
Searching...
No Matches
daw_json_parse_digit.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
13#include <daw/daw_attributes.h>
14
15namespace daw::json {
16 inline namespace DAW_JSON_VER {
17 namespace json_details {
18 [[nodiscard]] DAW_ATTRIB_INLINE constexpr unsigned parse_digit( char c ) {
19 return static_cast<unsigned>( static_cast<unsigned char>( c ) ) -
20 static_cast<unsigned>( static_cast<unsigned char>( '0' ) );
21 }
22
23 namespace parsed_constants {
24 inline constexpr unsigned decimal_char = parse_digit( '.' );
25 inline constexpr unsigned e_char = parse_digit( 'e' );
26 inline constexpr unsigned E_char = parse_digit( 'E' );
27 inline constexpr unsigned plus_char = parse_digit( '+' );
28 inline constexpr unsigned minus_char = parse_digit( '-' );
29 } // namespace parsed_constants
30 } // namespace json_details
31 } // namespace DAW_JSON_VER
32} // namespace daw::json
Customization point traits.
#define DAW_JSON_VER
The version string used in namespace definitions. Must be a valid namespace name.
Definition version.h:20