StormByte C++ Library: Logger module 1.2.0
StormByte-Logger is the logging module of the StormByte C++ suite.
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
StormByte::Logger::HexManip Struct Reference

Dump subsequent payloads as hex bytes until nohex. More...

#include <StormByte/logger/manipulators.hxx>

Public Member Functions

constexpr HexManip operator() (std::size_t n) const noexcept
 Build a manipulator with n bytes per row.
 

Public Attributes

std::size_t columns = 16
 Bytes per row; 0 = single line.
 

Detailed Description

Dump subsequent payloads as hex bytes until nohex.

The payload is converted as usual (numbers / bool to text, wide text to UTF-8) and then each byte is printed as 0xAA separated by spaces. columns is the number of bytes per continuation row; 0 disables wrapping. Continuations write a raw newline without a new header and without ending the logical line.

Encoding runs before redaction.

Usage:

log << hex << "AB" << std::endl; // 0x41 0x42 (16-byte rows)
log << hex(2) << "ABCD" << std::endl; // 0x41 0x42\\n0x43 0x44
log << nohex << "plain" << std::endl;
constexpr HexManip hex
Enable hex dumps with 16 bytes per row.
Definition manipulators.hxx:270
constexpr NoHexManip nohex
Disable hex dumps for subsequent payloads.
Definition manipulators.hxx:281

Member Function Documentation

◆ operator()()

constexpr HexManip StormByte::Logger::HexManip::operator() ( std::size_t  n) const
inlineconstexprnoexcept

Build a manipulator with n bytes per row.

Parameters
nBytes per continuation row; 0 disables wrapping.
Returns
A HexManip with the requested width.

Member Data Documentation

◆ columns

std::size_t StormByte::Logger::HexManip::columns = 16

Bytes per row; 0 = single line.


The documentation for this struct was generated from the following file: