Coverage Report

Created: 2025-06-13 06:46

/src/Fast-DDS/thirdparty/taocpp-pegtl/pegtl/internal/peek_char.hpp
Line
Count
Source (jump to first uncovered line)
1
// Copyright (c) 2014-2020 Dr. Colin Hirsch and Daniel Frey
2
// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
3
4
#ifndef TAO_PEGTL_INTERNAL_PEEK_CHAR_HPP
5
#define TAO_PEGTL_INTERNAL_PEEK_CHAR_HPP
6
7
#include <cstddef>
8
9
#include "../config.hpp"
10
11
#include "input_pair.hpp"
12
13
namespace tao
14
{
15
   namespace TAO_PEGTL_NAMESPACE
16
   {
17
      namespace internal
18
      {
19
         struct peek_char
20
         {
21
            using data_t = char;
22
            using pair_t = input_pair< char >;
23
24
            template< typename Input >
25
            static pair_t peek( Input& in ) noexcept( noexcept( in.empty() ) )
26
0
            {
27
0
               if( in.empty() ) {
28
0
                  return { 0, 0 };
29
0
               }
30
0
               return { in.peek_char(), 1 };
31
0
            }
32
         };
33
34
      }  // namespace internal
35
36
   }  // namespace TAO_PEGTL_NAMESPACE
37
38
}  // namespace tao
39
40
#endif