WPILibC++ 2024.3.2
position_t.h
Go to the documentation of this file.
1// __ _____ _____ _____
2// __| | __| | | | JSON for Modern C++
3// | | |__ | | | | | | version 3.11.2
4// |_____|_____|_____|_|___| https://github.com/nlohmann/json
5//
6// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
7// SPDX-License-Identifier: MIT
8
9#pragma once
10
11#include <cstddef> // size_t
12
14
16namespace detail
17{
18
19/// struct to capture the start position of the current token
21{
22 /// the total number of characters read
23 std::size_t chars_read_total = 0;
24 /// the number of characters read in the current line
25 std::size_t chars_read_current_line = 0;
26 /// the number of lines read
27 std::size_t lines_read = 0;
28
29 /// conversion to size_t to preserve SAX interface
30 constexpr operator size_t() const
31 {
32 return chars_read_total;
33 }
34};
35
36} // namespace detail
#define WPI_JSON_NAMESPACE_END
Definition: abi_macros.h:59
#define WPI_JSON_NAMESPACE_BEGIN
Definition: abi_macros.h:53
detail namespace with internal helper functions
Definition: xchar.h:20
struct to capture the start position of the current token
Definition: position_t.h:21
std::size_t chars_read_current_line
the number of characters read in the current line
Definition: position_t.h:25
std::size_t lines_read
the number of lines read
Definition: position_t.h:27
std::size_t chars_read_total
the total number of characters read
Definition: position_t.h:23