FE 0.9.0
Header-only C++ frontend library
Loading...
Searching...
No Matches
fe::Tab Class Reference

Keeps track of indentation level during output. More...

#include <fe/format.h>

Public Member Functions

Getters
constexpr int indent () const noexcept
constexpr std::string_view tab () const noexcept
Creates a new Tab
Tab operator+ (int indent) const noexcept
Tab operator- (int indent) const noexcept
Modifies this Tab
constexpr Taboperator++ () noexcept
constexpr Taboperator-- () noexcept
constexpr Taboperator+= (int indent) noexcept
constexpr Taboperator-= (int indent) noexcept

Friends

std::ostream & operator<< (std::ostream &os, Tab tab)

Construction

 Tab (const Tab &)=default
 Tab (std::string_view tab={"\t"}, int indent=0)
static Tab spaces ()

Detailed Description

Keeps track of indentation level during output.

Definition at line 67 of file format.h.

Constructor & Destructor Documentation

◆ Tab() [1/2]

fe::Tab::Tab ( const Tab & )
default

◆ Tab() [2/2]

fe::Tab::Tab ( std::string_view tab = {"\t"},
int indent = 0 )
inline

Definition at line 72 of file format.h.

References tab().

Member Function Documentation

◆ indent()

int fe::Tab::indent ( ) const
inlineconstexprnoexcept

Definition at line 83 of file format.h.

Referenced by operator+(), operator+=(), operator-(), and operator-=().

◆ operator+()

Tab fe::Tab::operator+ ( int indent) const
inlinenodiscardnoexcept

Definition at line 91 of file format.h.

References indent(), and Tab().

◆ operator++()

Tab & fe::Tab::operator++ ( )
inlineconstexprnoexcept

Definition at line 97 of file format.h.

References Tab().

◆ operator+=()

Tab & fe::Tab::operator+= ( int indent)
inlineconstexprnoexcept

Definition at line 99 of file format.h.

References indent(), and Tab().

◆ operator-()

Tab fe::Tab::operator- ( int indent) const
inlinenodiscardnoexcept

Definition at line 92 of file format.h.

References indent(), and Tab().

◆ operator--()

Tab & fe::Tab::operator-- ( )
inlineconstexprnoexcept

Definition at line 98 of file format.h.

References Tab().

◆ operator-=()

Tab & fe::Tab::operator-= ( int indent)
inlineconstexprnoexcept

Definition at line 100 of file format.h.

References indent(), and Tab().

◆ spaces()

Tab fe::Tab::spaces ( )
inlinestatic

Definition at line 78 of file format.h.

References Tab().

◆ tab()

std::string_view fe::Tab::tab ( ) const
inlineconstexprnoexcept

Definition at line 84 of file format.h.

Referenced by operator<<, and Tab().

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
Tab tab )
friend

Definition at line 104 of file format.h.

References Tab(), and tab().


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