FE 0.6.0
A header-only C++ library for writing frontends
Loading...
Searching...
No Matches
fe::Tab Class Reference

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

#include <fe/format.h>

Public Member Functions

 Tab (const Tab &)=default
 
 Tab (std::string_view tab={"\t"}, size_t indent=0)
 
Getters
size_t indent () const
 
std::string_view tab () const
 
Setters
Taboperator= (size_t indent)
 
Taboperator= (std::string tab)
 
Indent/Dedent
Taboperator++ ()
 
Taboperator-- ()
 
Taboperator+= (size_t indent)
 
Taboperator-= (size_t indent)
 
Tab operator++ (int)
 
Tab operator-- (int)
 
Tab operator+ (size_t indent) const
 
Tab operator- (size_t indent) const
 

Friends

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

Detailed Description

Keeps track of indentation level during output.

Definition at line 53 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"},
size_t indent = 0 )
inline

Definition at line 56 of file format.h.

Member Function Documentation

◆ indent()

size_t fe::Tab::indent ( ) const
inline

Definition at line 62 of file format.h.

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

◆ operator+()

Tab fe::Tab::operator+ ( size_t indent) const
inline

Definition at line 87 of file format.h.

References indent().

◆ operator++() [1/2]

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

Definition at line 81 of file format.h.

◆ operator++() [2/2]

Tab fe::Tab::operator++ ( int )
inline

Definition at line 85 of file format.h.

◆ operator+=()

Tab & fe::Tab::operator+= ( size_t indent)
inline

Definition at line 83 of file format.h.

References indent().

◆ operator-()

Tab fe::Tab::operator- ( size_t indent) const
inline

Definition at line 88 of file format.h.

References indent().

◆ operator--() [1/2]

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

Definition at line 82 of file format.h.

◆ operator--() [2/2]

Tab fe::Tab::operator-- ( int )
inline

Definition at line 86 of file format.h.

◆ operator-=()

Tab & fe::Tab::operator-= ( size_t indent)
inline

Definition at line 84 of file format.h.

References indent().

◆ operator=() [1/2]

Tab & fe::Tab::operator= ( size_t indent)
inline

Definition at line 68 of file format.h.

References indent().

◆ operator=() [2/2]

Tab & fe::Tab::operator= ( std::string tab)
inline

Definition at line 72 of file format.h.

References tab().

◆ tab()

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

Definition at line 63 of file format.h.

Referenced by operator=().

Friends And Related Symbol Documentation

◆ operator<<

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

Definition at line 92 of file format.h.


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