xentara-utils v1.2.1
Xentara utilities library
Loading...
Searching...
No Matches
xentara::utils::ios Namespace Reference

std::ios related functionality More...

Classes

class  Indent
 Automatic object that indents a stream. More...
 
class  ToLocalTime
 Manipulator for inserting time points into std::ostreams as local time. More...
 

Functions

auto indent (std::ostream &stream) -> std::ostream &
 Manipulator to add the current Indent into a stream.
 
auto shiftIn (std::ostream &stream) -> std::ostream &
 Manipulator to increase the indent of a stream.
 
auto shiftOut (std::ostream &stream) -> std::ostream &
 Manipulator to decrease the indent of a stream.
 
template<typename Char , typename Traits >
auto findWord (std::basic_istream< Char, Traits > &stream) -> std::basic_istream< Char, Traits > &
 Manipulator that finds the next word on the line.
 
template<typename Char , typename Traits >
auto skipBlanks (std::basic_istream< Char, Traits > &stream) -> std::basic_istream< Char, Traits > &
 Manipulator that skips blanks.
 
template<typename Char , typename Traits >
auto skipWord (std::basic_istream< Char, Traits > &stream) -> std::basic_istream< Char, Traits > &
 Manipulator that skips a word.
 
template<typename Char , typename Traits >
auto skipLine (std::basic_istream< Char, Traits > &stream) -> std::basic_istream< Char, Traits > &
 Manipulator that skips the rest of the line.
 
auto toLocalTime (std::chrono::system_clock::time_point time) -> ToLocalTime
 Creates a manipulator for inserting time points into std::ostreams as local time.
 
auto toCompactLocalTime (std::chrono::system_clock::time_point time) -> ToLocalTime
 Creates a manipulator for inserting time points into std::ostreams as local time.
 
auto toIsoLocalTime (std::chrono::system_clock::time_point time) -> ToLocalTime
 Creates a manipulator for inserting time points into std::ostreams as local time.
 

Detailed Description

std::ios related functionality

This namespace contains manipulators designed to be used with std::istream and/or std::ostream.

Function Documentation

◆ findWord()

template<typename Char , typename Traits >
auto xentara::utils::ios::findWord ( std::basic_istream< Char, Traits > &  stream) -> std::basic_istream<Char, Traits> &

Manipulator that finds the next word on the line.

This manipulator looks for the next word on the line by skipping blanks. It will set the fail bit on the stream if there are no more non-blank characters on the current line.

◆ indent()

auto xentara::utils::ios::indent ( std::ostream stream) -> std::ostream &

Manipulator to add the current Indent into a stream.

◆ shiftIn()

auto xentara::utils::ios::shiftIn ( std::ostream stream) -> std::ostream &

Manipulator to increase the indent of a stream.

◆ shiftOut()

auto xentara::utils::ios::shiftOut ( std::ostream stream) -> std::ostream &

Manipulator to decrease the indent of a stream.

◆ skipBlanks()

template<typename Char , typename Traits >
auto xentara::utils::ios::skipBlanks ( std::basic_istream< Char, Traits > &  stream) -> std::basic_istream<Char, Traits> &

Manipulator that skips blanks.

This manipulator behaves just like std::ws, but does not skip across the end of the line.

◆ skipLine()

template<typename Char , typename Traits >
auto xentara::utils::ios::skipLine ( std::basic_istream< Char, Traits > &  stream) -> std::basic_istream<Char, Traits> &

Manipulator that skips the rest of the line.

◆ skipWord()

template<typename Char , typename Traits >
auto xentara::utils::ios::skipWord ( std::basic_istream< Char, Traits > &  stream) -> std::basic_istream<Char, Traits> &

Manipulator that skips a word.

This manipulator skips the current word by skipping all characters that are not blanks. If no characters are skipped, the fail bit is set.

◆ toCompactLocalTime()

auto xentara::utils::ios::toCompactLocalTime ( std::chrono::system_clock::time_point  time) -> ToLocalTime

Creates a manipulator for inserting time points into std::ostreams as local time.

The returned manipulator only outputs as much of seconds and fractions of a second as necessary

Parameters
timeThe time to insert

◆ toIsoLocalTime()

auto xentara::utils::ios::toIsoLocalTime ( std::chrono::system_clock::time_point  time) -> ToLocalTime

Creates a manipulator for inserting time points into std::ostreams as local time.

The returned manipulator uses the format YYYY-MM-DDThh:mm:ss.zzzzzzzzz±HH:MM. For a utcOffset of 0, ±HH:MM is replaced with the character “Z”.

Parameters
timeThe time to insert

◆ toLocalTime()

auto xentara::utils::ios::toLocalTime ( std::chrono::system_clock::time_point  time) -> ToLocalTime

Creates a manipulator for inserting time points into std::ostreams as local time.

The returned manipulator always outputs the full time with nanosecond precision

Parameters
timeThe time to insert