|
libcosmos
Linux C++ System Programming Library
|
#include <iomanip>#include <functional>#include <ostream>#include <string>#include <sstream>#include <type_traits>#include <cosmos/compiler.hxx>#include <cosmos/dso_export.h>#include <cosmos/fs/types.hxx>#include <cosmos/proc/types.hxx>#include <cosmos/string.hxx>#include <cosmos/thread/thread.hxx>#include <cosmos/types.hxx>#include <cosmos/utils.hxx>Go to the source code of this file.
Classes | |
| struct | cosmos::FormattedNumber< NUM > |
| Base class for HexNum and OctNum format output helpers. More... | |
| struct | cosmos::HexNum< NUM > |
| Helper to output a primitive integer as hexadecimal in the style of 0x1234. More... | |
| struct | cosmos::OctNum< NUM > |
| Helper to output a primitive integer as octal in the style of 0o123. More... | |
Functions | |
| std::ostream & | operator<< (std::ostream &o, const cosmos::ProcessID &pid) |
| std::ostream & | operator<< (std::ostream &o, const cosmos::ThreadID &tid) |
| std::ostream & | operator<< (std::ostream &o, const cosmos::UserID &uid) |
| std::ostream & | operator<< (std::ostream &o, const cosmos::GroupID &gid) |
| std::ostream & | operator<< (std::ostream &o, const cosmos::SignalNr &sig) |
| std::ostream & | operator<< (std::ostream &o, const cosmos::FileNum &fd) |
| template<typename NUM > | |
| std::ostream & | operator<< (std::ostream &o, const cosmos::FormattedNumber< NUM > &fmtnum) |
| template<typename T > | |
| auto | cosmos::to_printable_integer (T num) -> decltype(+num) |
| This helper makes sure that any integer is turned into a printable integer. | |
| std::string | cosmos::sprintf (const char *fmt,...) COSMOS_FORMAT_PRINTF(1 |
This is a C++ variant of the libc sprintf() function. | |
C stdio and C++ iostream related helper types and functions. Also some output operators for cosmos primitive types.
Definition in file formatting.hxx.
|
inline |
Definition at line 64 of file formatting.hxx.
| std::ostream & operator<< | ( | std::ostream & | o, |
| const cosmos::FormattedNumber< NUM > & | fmtnum ) |
Definition at line 68 of file formatting.cxx.
|
inline |
Definition at line 52 of file formatting.hxx.
|
inline |
Definition at line 33 of file formatting.hxx.
|
inline |
Definition at line 58 of file formatting.hxx.
|
inline |
Definition at line 40 of file formatting.hxx.
|
inline |
Definition at line 46 of file formatting.hxx.
| COSMOS_API std::string cosmos::sprintf | ( | const char * | fmt, |
| ... ) |
This is a C++ variant of the libc sprintf() function.
This function is taking care of the memory management details of sprintf() and returns the fully formatted string as a std::string object.
On error an empty string is returned.
Definition at line 57 of file formatting.cxx.
| auto cosmos::to_printable_integer | ( | T | num | ) | -> decltype(+num) |
This helper makes sure that any integer is turned into a printable integer.
Attempting to output a char related type onto an ostream will print its symbolic value as opposed to its numerical representation. To avoid this effect this helper function can be used to return a representation of num that will be printed as a numerical value when output onto an ostream.
Definition at line 157 of file formatting.hxx.