xentara-utils v2.0.4
The Xentara Utility 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

Indenting
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.
 
Line Parsing
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.
 
Formatting Functions
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.

Include file
#include <xentara/utils/ios/LineParsing.hpp>

◆ indent()

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

Manipulator to add the current Indent into a stream.

Include file
#include <xentara/utils/ios/Indent.hpp>

◆ shiftIn()

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

Manipulator to increase the indent of a stream.

Include file
#include <xentara/utils/ios/Indent.hpp>

◆ shiftOut()

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

Manipulator to decrease the indent of a stream.

Include file
#include <xentara/utils/ios/Indent.hpp>

◆ 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.

Include file
#include <xentara/utils/ios/LineParsing.hpp>

◆ 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.

Include file
#include <xentara/utils/ios/LineParsing.hpp>

◆ 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.

Include file
#include <xentara/utils/ios/LineParsing.hpp>

◆ 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

Include file
#include <xentara/utils/ios/toLocalTime.hpp>
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”.

Include file
#include <xentara/utils/ios/toLocalTime.hpp>
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

Include file
#include <xentara/utils/ios/toLocalTime.hpp>
Parameters
timeThe time to insert