General Utility Library for C++14
2.11
|
Helper object used to enable a convenient syntax to dump things to a stream.
It just forwards the parameters to hexdump_stream() to the appropriate operator<<. Member cont_ holds the container if a temporary has been used for dumping.
#include <hexdump.h>
Public Member Functions | |
HexdumpParameterForward (IteratorT begin_it, IteratorT end_it, std::string prompt, ContainerT &&cont) | |
Construct a hexdump parameter forwarder object. More... | |
HexdumpParameterForward (const HexdumpParameterForward &other) | |
Copy constructor (automatically updates the begin_ and end_ interator members if the copied object holds a container). | |
HexdumpParameterForward (HexdumpParameterForward &&other) noexcept | |
Move constructor (automatically updates the begin_ and end_ interator members if the moved-from object holds a container). | |
HexdumpParameterForward & | operator= (const HexdumpParameterForward &other) |
Copy assignment (automatically updates the begin_ and end_ interator members if the copied object holds a container). | |
HexdumpParameterForward & | operator= (HexdumpParameterForward &&other) noexcept |
Move assignment (automatically updates the begin_ and end_ interator members if the moved-from object holds a container). | |
Public Attributes | |
IteratorT | begin_ |
Iterator to begin of elements to be dumped (in iterator mode) | |
IteratorT | end_ |
Iterator past end of elements to be dumped (in iterator mode) | |
std::string | prompt_ |
Possible prompt to prepend to the dump. | |
ContainerT | cont_ |
A container with the elements to be dumped (in container/temporary mode) | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const HexdumpParameterForward< IteratorT, ContainerT > &hdp) |
Overload of std::ostream's operator<< to enable a convenient syntax to dump things to a stream. More... | |
|
inline |
Construct a hexdump parameter forwarder object.
begin_it | Start iterator (meaningless if a container is passed). |
end_it | End iterator (meaningless if a container is passed). |
prompt | A string to be printed alongside the hexdump output. |
cont | The container to be hexdumped (can be nullptr if iterators are used). |
|
friend |
Overload of std::ostream's operator<< to enable a convenient syntax to dump things to a stream.
Can also be used for ofstreams or stringstreams.
The stream is filled successively with the dumped data, no internal representation of the dump is generated.