24 #ifndef __TINYBYTESTREAM_H 25 #define __TINYBYTESTREAM_H 53 u_length = strlen (cp_in) + 1;
55 memcpy (bp_in, cp_in, u_length);
57 bp_end = bp_in + u_length - 1;
58 o_valid = (bp_current !=
bp_end);
77 o_valid = (bp_current !=
bp_end);
78 return * (bp_current - 1);
94 return bp_current [u_nb_char];
100 return bp_current - u_amount + 1;
_byte_ b_top()
Returns the byte on top.
Definition: byte_stream.h:67
_byte_ b_forward(unsigned u_nb_char)
peek a byte a little further down the stream
Definition: byte_stream.h:91
unsigned u_remain()
number of bytes still to consume
Definition: byte_stream.h:86
Definition: action_store.cpp:32
_byte_ * bp_current
Current read position.
Definition: byte_stream.h:44
unsigned char _byte_
Definition: lex_util.h:44
~ byte_stream()
destructor
Definition: byte_stream.h:61
_byte_ * bp_in
Total string.
Definition: byte_stream.h:42
_byte_ * bp_end
First invalid position.
Definition: byte_stream.h:46
bool o_is_valid()
true if there are still some byte to consume
Definition: byte_stream.h:81
unsigned u_length
Length of the total string, + 1.
Definition: byte_stream.h:40
byte_stream(const char *cp_in)
constructor
Definition: byte_stream.h:51
const _byte_ * bp_get_backward(unsigned u_amount)
get a byte backward pointer to the stream
Definition: byte_stream.h:98
bool o_valid
true when there are still some byte to read
Definition: byte_stream.h:48
_byte_ b_pop()
Consumes one byte.
Definition: byte_stream.h:72
Definition: byte_stream.h:37