AsList< Container > Class Template Reference

std::ostream manipulator to print containers as flat lists More...

#include <IoManip.h>

Collaboration diagram for AsList< Container >:

Public Member Functions

 AsList (const Container &c)
 
auto & prefixedBy (const char *const p)
 a c-string to print before the first item (if any). Caller must ensure lifetime. More...
 
auto & suffixedBy (const char *const p)
 a c-string to print after the last item (if any). Caller must ensure lifetime. More...
 
auto & delimitedBy (const char *const d)
 a c-string to print between consecutive items (if any). Caller must ensure lifetime. More...
 
auto & quoted (const char *const q="\"")
 c-string to print before and after each item. Caller must ensure lifetime. More...
 
auto & quoted (const char *const preQ, const char *const postQ)
 c-strings to print before and after each item. Caller must ensure lifetime. More...
 
void print (std::ostream &) const
 writes the container to the given stream More...
 

Public Attributes

const Container & container
 zero or more items to print More...
 
const char * prefix = nullptr
 a c-string to print before the first item (if any). Caller must ensure lifetime. More...
 
const char * suffix = nullptr
 a c-string to print after the last item (if any). Caller must ensure lifetime. More...
 
const char * delimiter = nullptr
 a c-string to print between consecutive items (if any). Caller must ensure lifetime. More...
 
const char * preQuote = nullptr
 optional c-string to print before each item; More...
 
const char * postQuote = nullptr
 optional c-string to print after each item; More...
 

Detailed Description

template<typename Container>
class AsList< Container >

Definition at line 176 of file IoManip.h.

Constructor & Destructor Documentation

◆ AsList()

template<typename Container >
AsList< Container >::AsList ( const Container &  c)
inlineexplicit

Definition at line 179 of file IoManip.h.

Member Function Documentation

◆ delimitedBy()

template<typename Container >
auto& AsList< Container >::delimitedBy ( const char *const  d)
inline

Definition at line 188 of file IoManip.h.

References AsList< Container >::delimiter.

Referenced by ErrorState::Dump(), and operator<<().

◆ prefixedBy()

template<typename Container >
auto& AsList< Container >::prefixedBy ( const char *const  p)
inline

Definition at line 182 of file IoManip.h.

References AsList< Container >::prefix.

Referenced by dump_peer_options(), and operator<<().

◆ print()

template<typename Container >
void AsList< Container >::print ( std::ostream &  os) const

Definition at line 211 of file IoManip.h.

References delimiter.

Referenced by operator<<().

◆ quoted() [1/2]

template<typename Container >
auto& AsList< Container >::quoted ( const char *const  preQ,
const char *const  postQ 
)
inline

Definition at line 194 of file IoManip.h.

References AsList< Container >::postQuote, and AsList< Container >::preQuote.

◆ quoted() [2/2]

template<typename Container >
auto& AsList< Container >::quoted ( const char *const  q = "\"")
inline

Definition at line 191 of file IoManip.h.

References AsList< Container >::postQuote, and AsList< Container >::preQuote.

◆ suffixedBy()

template<typename Container >
auto& AsList< Container >::suffixedBy ( const char *const  p)
inline

Definition at line 185 of file IoManip.h.

References AsList< Container >::suffix.

Member Data Documentation

◆ container

template<typename Container >
const Container& AsList< Container >::container

Definition at line 200 of file IoManip.h.

◆ delimiter

template<typename Container >
const char* AsList< Container >::delimiter = nullptr

Definition at line 204 of file IoManip.h.

Referenced by AsList< Container >::delimitedBy().

◆ postQuote

template<typename Container >
const char* AsList< Container >::postQuote = nullptr
See also
quoted()

Definition at line 206 of file IoManip.h.

Referenced by AsList< Container >::quoted().

◆ prefix

template<typename Container >
const char* AsList< Container >::prefix = nullptr

Definition at line 202 of file IoManip.h.

Referenced by AsList< Container >::prefixedBy().

◆ preQuote

template<typename Container >
const char* AsList< Container >::preQuote = nullptr
See also
quoted()

Definition at line 205 of file IoManip.h.

Referenced by AsList< Container >::quoted().

◆ suffix

template<typename Container >
const char* AsList< Container >::suffix = nullptr

Definition at line 203 of file IoManip.h.

Referenced by AsList< Container >::suffixedBy().


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

 

Introduction

Documentation

Support

Miscellaneous