#include <span_reader.hh>
|
| SpanReader (span_type &s) |
|
char * | write_all (const char *begin, const char *end) |
|
char * | read_available (char *start, char *end) |
|
char * | read_exactly (char *start, const char *end) |
|
char * | peek (char *start, const char *end) |
|
template<typename It > |
std::vector< char > | read_until (It begin_set, It end_set) |
|
template<typename It , typename OutIt > |
OutIt | read_until (It begin_set, It end_set, OutIt dest_start, OutIt dest_end) |
|
nds_impl::common::SpanReader::SpanReader |
( |
span_type & |
s | ) |
|
|
inline |
char* nds_impl::common::SpanReader::cur_data |
( |
| ) |
|
|
inlineprivate |
char* nds_impl::common::SpanReader::peek |
( |
char * |
start, |
|
|
const char * |
end |
|
) |
| |
|
inline |
Return the next data (enough to fill [start, end)). No data will be removed from the internal buffer. The data will still be avaialble in the buffered reader for retreival.
- Parameters
-
start | Start of the destination |
end | Byte just past the end of the destination |
- Returns
- end
char* nds_impl::common::SpanReader::read_available |
( |
char * |
start, |
|
|
char * |
end |
|
) |
| |
|
inline |
A read the data that is currently available.
- Parameters
-
start | Start address of the destination |
end | Address of the byte past the last in the destination |
- Returns
- A pointer in [start, end] that is the next location
- Note
- raises an exception if there is no more data
char* nds_impl::common::SpanReader::read_exactly |
( |
char * |
start, |
|
|
const char * |
end |
|
) |
| |
|
inline |
Read exactly enough data to fill the range [start,end)
- Parameters
-
start | Start of the destination |
end | Byte just past the end of the destination |
- Returns
- end
template<typename It >
std::vector< char > nds_impl::common::SpanReader::read_until |
( |
It |
begin_set, |
|
|
It |
end_set |
|
) |
| |
|
inline |
Read until a value in [begin_set,end_set) is found in the input stream.
- Template Parameters
-
It | An iterator that dereferences chars |
- Parameters
-
begin_set | Start of the list of terminators |
end_set | End of the list of terminators |
- Returns
- A std::vector<char> of the data that was read in, including the terminator that was found.
This will retrieve data from the underlying reader as needed
template<typename It , typename OutIt >
OutIt nds_impl::common::SpanReader::read_until |
( |
It |
begin_set, |
|
|
It |
end_set, |
|
|
OutIt |
dest_start, |
|
|
OutIt |
dest_end |
|
) |
| |
|
inline |
Read until a value in [begin_set,end_set) is found in the input stream. This will write a bounded amount of data up to [dest_start, dest_end)
- Template Parameters
-
It | An iterator that dereferences chars |
- Parameters
-
begin_set | Start of the list of terminators |
end_set | End of the list of terminators |
dest_start | Start of the destination |
dest_end | one past the last destination point |
This will retrieve data from the underlying reader as needed
char* nds_impl::common::SpanReader::write_all |
( |
const char * |
begin, |
|
|
const char * |
end |
|
) |
| |
|
inline |
The documentation for this class was generated from the following file: