FE 0.15.0
A C++23 toolkit for writing compiler/interpreter frontends.
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
constexpr Tab operator+ (int indent) const noexcept
constexpr 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

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

Detailed Description

Keeps track of indentation level during output.

Definition at line 64 of file format.h.

Constructor & Destructor Documentation

◆ Tab() [1/2]

fe::Tab::Tab ( const Tab & )
constexprdefault

◆ Tab() [2/2]

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

Definition at line 69 of file format.h.

References tab().

Member Function Documentation

◆ indent()

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

Definition at line 80 of file format.h.

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

◆ operator+()

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

Definition at line 88 of file format.h.

References indent(), and Tab().

◆ operator++()

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

Definition at line 94 of file format.h.

References Tab().

◆ operator+=()

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

Definition at line 96 of file format.h.

References indent(), and Tab().

◆ operator-()

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

Definition at line 89 of file format.h.

References indent(), and Tab().

◆ operator--()

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

Definition at line 95 of file format.h.

References Tab().

◆ operator-=()

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

Definition at line 97 of file format.h.

References indent(), and Tab().

◆ spaces()

constexpr Tab fe::Tab::spaces ( )
inlinestaticconstexprnoexcept

Definition at line 75 of file format.h.

References Tab().

◆ tab()

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

Definition at line 81 of file format.h.

Referenced by operator<<, and Tab().

◆ operator<<

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

Definition at line 101 of file format.h.

References Tab(), and tab().


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