32#include "../my_config.h"
50 eols(
const std::deque<std::string> & end_sequences);
52 eols(
const eols & ref) { copy_from(ref); };
53 eols(
eols && ref)
noexcept =
default;
54 eols & operator = (
const eols & ref) { copy_from(ref);
return *
this; };
55 eols & operator = (
eols && ref) =
default;
79 U_I & eol_sequence_length,
80 U_I & after_eol_read_bytes)
const;
86 in_progress(
const std::string & val): ref(val) { reset(); };
89 void reset()
const { next_to_match = ref.begin(); bypass =
false; passed = 0; larger =
false; };
90 bool match(
char next_read_byte)
const;
91 U_I progression()
const;
92 bool set_bypass(U_I prog)
const;
93 void set_larger()
const { larger =
true; };
94 bool has_matched()
const {
return next_to_match == ref.end(); };
98 mutable std::string::const_iterator next_to_match;
104 std::deque<in_progress> eols_curs;
105 mutable U_I ref_progression;
111 bool all_bypassed_or_matched()
const;
112 bool find_larger_match(U_I & seq_length, U_I & read_after_eol)
const;
113 void copy_from(
const eols & ref);
the class eols provide a way to detect the presence of string from a list of string in a byte flow
bool bypass_or_larger(U_I prog) const
set bypass flag for all in_progress of eols_curs that progression is less than or equal 'prog'
void add_sequence(const std::string &seq)
add a new sequence for End of Line
void reset_detection() const
reset the detection to be beginning of each EOL sequence
bool eol_reached(char next_read_byte, U_I &eol_sequence_length, U_I &after_eol_read_bytes) const
check whether we have reach an end of line
are defined here basic integer types that tend to be portable
libdar namespace encapsulate all libdar symbols