Parent template for the byte array formatters. More...
#include <formatters.hpp>
Public Member Functions | |
ByteArrayFormatter () | |
ByteArrayFormatter< Byte, N > & | operator() (const Array< Byte, N > &array) |
ByteArrayFormatter< Byte, N > & | operator() (const Stencil< Array< Byte, N > > &stencil) |
ByteArrayFormatter< Byte, N > & | operator() (typename Array< Byte, N >::const_iterator begin_iter, typename Array< Byte, N >::const_iterator end_iter) ecl_assert_throw_decl(StandardException) |
Formats on a window of the array. | |
virtual | ~ByteArrayFormatter () |
Private Attributes | |
Array< Byte, N >::const_iterator | begin_iterator |
Array< Byte, N >::const_iterator | end_iterator |
bool | ready_to_format |
Friends | |
template<typename OutputStream , typename CharType , size_t M> | |
OutputStream & | operator<< (OutputStream &ostream, const ByteArrayFormatter< CharType, M > &formatter) ecl_assert_throw_decl(StandardException) |
Parent template for the byte array formatters.
We dont accept arguments for this class, it is simply designed to present byte arrays in hex format byte by byte. If you want specialised formatting for the character array, iterate over it with the Format<char> (or signed/unsigned char) class.
It will also accept stencils which have an underlying array of the required type.
Do not use this class directly, rather call it via either the Array or Format classes explicitly. This makes the code more readable. e.g.
Array<char>::Formatter format_array_1;
Format< Array<char,4> > format_array_2; // same thing
Byte | : byte type, signed char/char/unsigned char. |
N | : the size of the container to be formatted. |
Definition at line 107 of file array/formatters.hpp.
ecl::formatters::ByteArrayFormatter< Byte, N >::ByteArrayFormatter | ( | ) | [inline] |
Default constructor that simply sets up the formatter for use. There is only one formatting style for this - a byte by byte view of the array in hex format, so we don't accept any arguments. If you want specialised formatting for your array, iterate it element by element with the Format<signed char> class.
Definition at line 117 of file array/formatters.hpp.
virtual ecl::formatters::ByteArrayFormatter< Byte, N >::~ByteArrayFormatter | ( | ) | [inline, virtual] |
Definition at line 169 of file array/formatters.hpp.
ByteArrayFormatter<Byte,N>& ecl::formatters::ByteArrayFormatter< Byte, N >::operator() | ( | const Array< Byte, N > & | array | ) | [inline] |
The format operator. Use this when inserting into a stream. It returns a template on which the stream will perform the formatting to create the requested output.
array | : the array to format. |
Definition at line 126 of file array/formatters.hpp.
ByteArrayFormatter<Byte,N>& ecl::formatters::ByteArrayFormatter< Byte, N >::operator() | ( | const Stencil< Array< Byte, N > > & | stencil | ) | [inline] |
The format operator. Use this when inserting into a stream. It returns a template on which the stream will perform the formatting to create the requested output.
stencil | : a stencil on an underlying array of the requisite type. |
Definition at line 140 of file array/formatters.hpp.
ByteArrayFormatter<Byte,N>& ecl::formatters::ByteArrayFormatter< Byte, N >::operator() | ( | typename Array< Byte, N >::const_iterator | begin_iter, |
typename Array< Byte, N >::const_iterator | end_iter | ||
) | [inline] |
Formats on a window of the array.
Format over the window specified.
begin_iter | : point in the array to begin formatting from. |
end_iter | : point in the array to begin formatting to. |
StandardException | : throws if indices are out of range [debug mode only]. |
Definition at line 158 of file array/formatters.hpp.
OutputStream& operator<< | ( | OutputStream & | ostream, |
const ByteArrayFormatter< CharType, M > & | formatter | ||
) | [friend] |
Insertion operator for sending the formatter (for character arrays) to an output stream.
OutputStream | : the type of the output stream to be inserted into. |
M | : the size of the container to be formatted. |
ostream | : the output stream. |
formatter | : the formatter to be inserted. |
StandardException | : throws if the formatter is used multiply in one stream operation [debug mode only]. |
Definition at line 195 of file array/formatters.hpp.
Array<Byte,N>::const_iterator ecl::formatters::ByteArrayFormatter< Byte, N >::begin_iterator [private] |
Definition at line 185 of file array/formatters.hpp.
Array<Byte,N>::const_iterator ecl::formatters::ByteArrayFormatter< Byte, N >::end_iterator [private] |
Definition at line 186 of file array/formatters.hpp.
bool ecl::formatters::ByteArrayFormatter< Byte, N >::ready_to_format [private] |
Definition at line 187 of file array/formatters.hpp.