OpenMPTL - Helper Library
C++ Microprocessor Template Library
Classes | Functions
poorman Namespace Reference

Classes

class  ostream
 

Functions

template<typename Tp >
void itoa_hex (char *buf, Tp value, int n=sizeof(Tp) *2, char padding='0')
 Prints "value" as hexadecimal number to buf, '0'-padded, zero terminated. More...
 
template<typename Tp >
std::enable_if< std::is_unsigned< Tp >::value >::type itoa (char *buf, Tp value, int n, char padding='0')
 Prints n digits of "value" to buf, right aligned, "padding"-padded, zero terminated. More...
 
template<typename Tp >
std::enable_if< std::is_signed< Tp >::value >::type itoa (char *buf, Tp value, int n, char padding='0')
 
template<typename Tp >
ostream< Tp > & flush (ostream< Tp > &st)
 manipulator, flushes the output stream More...
 
template<typename Tp >
ostream< Tp > & endl (ostream< Tp > &st)
 manipulator, outputs newline and flushes the output stream More...
 

Function Documentation

◆ endl()

template<typename Tp >
ostream<Tp>& poorman::endl ( ostream< Tp > &  st)
inline

◆ flush()

template<typename Tp >
ostream<Tp>& poorman::flush ( ostream< Tp > &  st)
inline

◆ itoa() [1/2]

template<typename Tp >
std::enable_if< std::is_unsigned< Tp >::value >::type poorman::itoa ( char *  buf,
Tp  value,
int  n,
char  padding = '0' 
)

Prints '~' as first character if "value" has more digits than n.

NOTE: sizeof(buf) must be at least n+1

◆ itoa() [2/2]

template<typename Tp >
std::enable_if< std::is_signed< Tp >::value >::type poorman::itoa ( char *  buf,
Tp  value,
int  n,
char  padding = '0' 
)

◆ itoa_hex()

template<typename Tp >
void poorman::itoa_hex ( char *  buf,
Tp  value,
int  n = sizeof(Tp)*2,
char  padding = '0' 
)

Negative values are printed as two's complement.

NOTE: sizeof(buf) must be at least n+1