/usr/include/pegtl/internal/input_mark.hh is in pegtl-dev 1.3.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | // Copyright (c) 2014-2015 Dr. Colin Hirsch and Daniel Frey
// Please see LICENSE for license or visit https://github.com/ColinH/PEGTL/
#ifndef PEGTL_INTERNAL_INPUT_MARK_HH
#define PEGTL_INTERNAL_INPUT_MARK_HH
#include "input_data.hh"
namespace pegtl
{
namespace internal
{
class input_mark
{
public:
explicit
input_mark( input_data & i )
: m_line( i.line ),
m_column( i.column ),
m_begin( i.begin ),
m_input( & i )
{ }
input_mark( input_mark && i )
: m_line( i.m_line ),
m_column( i.m_column ),
m_begin( i.m_begin ),
m_input( i.m_input )
{
i.m_input = nullptr;
}
~input_mark()
{
if ( m_input ) {
m_input->line = m_line;
m_input->column = m_column;
m_input->begin = m_begin;
}
}
input_mark( const input_mark & ) = delete;
void operator= ( const input_mark & ) = delete;
bool success()
{
m_input = nullptr;
return true;
}
bool failure()
{
m_input->line = m_line;
m_input->column = m_column;
m_input->begin = m_begin;
m_input = nullptr;
return false;
}
bool operator() ( const bool result )
{
return result ? success() : failure();
}
public:
const std::size_t m_line;
const std::size_t m_column;
const char * const m_begin;
input_data * m_input;
};
} // internal
} // pegtl
#endif
|