OGLplus  (0.59.0) a C++ wrapper for rendering APIs

hexdump.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_HEXDUMP_HPP
10 #define EAGINE_HEXDUMP_HPP
11 
12 #include "callable_ref.hpp"
13 #include "config/basic.hpp"
14 #include "memory/block.hpp"
15 #include "types.hpp"
16 #include "valid_if/decl.hpp"
17 #include <iosfwd>
18 
19 namespace eagine {
20 
29 class hexdump {
30 public:
33  : _mb{mb} {}
34 
37 
39  using char_putter = callable_ref<bool(char)>;
40 
42  static void apply(byte_getter get_byte, char_putter put_char);
43 
45  friend auto operator<<(std::ostream&, const hexdump&) -> std::ostream&;
46 
47 private:
49 };
50 
51 } // namespace eagine
52 
53 #if !EAGINE_LINK_LIBRARY || defined(EAGINE_IMPLEMENTING_LIBRARY)
54 #include <eagine/hexdump.inl>
55 #endif
56 
57 #endif // EAGINE_HEXDUMP_HPP
Declaration of class template storing a reference to a callable object.
Definition: callable_ref.hpp:24
Common code is placed in this namespace.
Definition: eagine.hpp:21
hexdump(memory::const_block mb) noexcept
Construction initializing the dumped memory block.
Definition: hexdump.hpp:32
Class for encoding byte blocks into hexdump-like format.
Definition: hexdump.hpp:29
Non-owning view of a contiguous range of memory with ValueType elements.
Definition: flatten_fwd.hpp:16
friend auto operator<<(std::ostream &, const hexdump &) -> std::ostream &
Operator for writing instances of hexdump to standard output streams.
static void apply(byte_getter get_byte, char_putter put_char)
Uses get_byte to read input bytes, encodes them and calls put_char.

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).