IoManip.h File Reference
#include "debug/Stream.h"
#include <iostream>
#include <iomanip>
#include <optional>
Include dependency graph for IoManip.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  RawPointerT< Pointer >
 
class  AsHex< Integer >
 
class  AsList< Container >
 std::ostream manipulator to print containers as flat lists More...
 
class  AtMostOnce< T >
 
class  WithExtras< T >
 Helps prints T object using object's T::printWithExtras() method. More...
 

Functions

template<class Pointer >
RawPointerT< Pointer > RawPointer (const char *label, const Pointer &ptr)
 convenience wrapper for creating RawPointerT<> objects More...
 
template<class Pointer >
RawPointerT< Pointer > RawPointer (const Pointer &ptr)
 convenience wrapper for creating RawPointerT<> objects without a label More...
 
template<class Pointer >
std::ostream & operator<< (std::ostream &os, const RawPointerT< Pointer > &pd)
 prints RawPointerT<>, dereferencing the io_manip pointer if possible More...
 
template<class Integer >
std::ostream & operator<< (std::ostream &os, const AsHex< Integer > number)
 
template<class Integer >
AsHex< Integer > asHex (const Integer n)
 a helper to ease AsHex object creation More...
 
void PrintHex (std::ostream &, const char *data, size_t n)
 Prints the first n data bytes using hex notation. Does nothing if n is 0. More...
 
template<typename Container >
std::ostream & operator<< (std::ostream &os, const AsList< Container > &manipulator)
 
template<typename Container >
auto asList (const Container &c)
 a helper to ease AsList object creation More...
 
template<class T >
auto & operator<< (std::ostream &os, AtMostOnce< T > &a)
 
template<class T >
auto & operator<< (std::ostream &os, const WithExtras< T > &a)
 writes T object to the given stream using object's T::printWithExtras() method More...
 

Function Documentation

◆ asHex()

◆ asList()

template<typename Container >
auto asList ( const Container &  c)
inline

Definition at line 246 of file IoManip.h.

Referenced by Acl::Node::dumpWhole().

◆ operator<<() [1/5]

template<class T >
auto& operator<< ( std::ostream &  os,
AtMostOnce< T > &  a 
)
inline

Prints AtMostOnce argument if needed. The argument is not constant to prevent wrong usage:

/* Compiler error: cannot bind non-const lvalue reference to an rvalue */
os << AtMostOnce(x);

Definition at line 286 of file IoManip.h.

References AtMostOnce< T >::print().

◆ operator<<() [2/5]

template<class Integer >
std::ostream& operator<< ( std::ostream &  os,
const AsHex< Integer >  number 
)
inline

Definition at line 143 of file IoManip.h.

◆ operator<<() [3/5]

template<typename Container >
std::ostream& operator<< ( std::ostream &  os,
const AsList< Container > &  manipulator 
)
inline

Definition at line 238 of file IoManip.h.

References AsList< Container >::print().

◆ operator<<() [4/5]

template<class Pointer >
std::ostream& operator<< ( std::ostream &  os,
const RawPointerT< Pointer > &  pd 
)
inline

◆ operator<<() [5/5]

template<class T >
auto& operator<< ( std::ostream &  os,
const WithExtras< T > &  a 
)
inline

Definition at line 304 of file IoManip.h.

References WithExtras< T >::toPrint.

◆ PrintHex()

void PrintHex ( std::ostream &  ,
const char *  data,
size_t  n 
)

Definition at line 16 of file IoManip.cc.

References assert, and for_each().

Referenced by Raw::print(), and PrintSecret().

◆ RawPointer() [1/2]

template<class Pointer >
RawPointerT<Pointer> RawPointer ( const char *  label,
const Pointer &  ptr 
)
inline

◆ RawPointer() [2/2]

template<class Pointer >
RawPointerT<Pointer> RawPointer ( const Pointer &  ptr)
inline

Definition at line 81 of file IoManip.h.

 

Introduction

Documentation

Support

Miscellaneous