CppParser
Loading...
Searching...
No Matches
CppIndent Class Reference

Helper class to manage indentation while writing C++ file from AST. More...

#include <cppindent.h>

Collaboration diagram for CppIndent:
Collaboration graph

Public Types

enum  Type {
  kTab , kSingleSpace , kDoubleSpace , kTripleSpace ,
  kQuadSpace
}
 

Public Member Functions

 CppIndent (std::uint16_t initialLevel=0, Type type=kDoubleSpace)
 
std::uint16_t depth () const
 
CppIndentoperator++ ()
 
CppIndentoperator-- ()
 
CppIndent operator++ (int)
 
CppIndent operator-- (int)
 
const char * indentStr () const
 
std::string toString () const
 
void emit (std::ostream &stm) const
 
CppIndent resetted () const
 

Private Attributes

std::uint16_t indentLevel_
 
const std::uint16_t initialLevel_
 
Type type_
 

Detailed Description

Helper class to manage indentation while writing C++ file from AST.

Definition at line 32 of file cppindent.h.

Member Enumeration Documentation

◆ Type

Enumerator
kTab 
kSingleSpace 
kDoubleSpace 
kTripleSpace 
kQuadSpace 

Definition at line 35 of file cppindent.h.

Constructor & Destructor Documentation

◆ CppIndent()

CppIndent::CppIndent ( std::uint16_t  initialLevel = 0,
Type  type = kDoubleSpace 
)
inline

Definition at line 50 of file cppindent.h.

Member Function Documentation

◆ depth()

std::uint16_t CppIndent::depth ( ) const
inline

Definition at line 56 of file cppindent.h.

◆ emit()

void CppIndent::emit ( std::ostream &  stm) const
inline

Definition at line 100 of file cppindent.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ indentStr()

const char * CppIndent::indentStr ( ) const
inline

Definition at line 85 of file cppindent.h.

Here is the caller graph for this function:

◆ operator++() [1/2]

CppIndent & CppIndent::operator++ ( )
inline

Definition at line 60 of file cppindent.h.

◆ operator++() [2/2]

CppIndent CppIndent::operator++ ( int  )
inline

Definition at line 71 of file cppindent.h.

◆ operator--() [1/2]

CppIndent & CppIndent::operator-- ( )
inline

Definition at line 65 of file cppindent.h.

◆ operator--() [2/2]

CppIndent CppIndent::operator-- ( int  )
inline

Definition at line 77 of file cppindent.h.

◆ resetted()

CppIndent CppIndent::resetted ( ) const
inline

Definition at line 108 of file cppindent.h.

Here is the caller graph for this function:

◆ toString()

std::string CppIndent::toString ( ) const
inline

Definition at line 90 of file cppindent.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ indentLevel_

std::uint16_t CppIndent::indentLevel_
private

Definition at line 45 of file cppindent.h.

◆ initialLevel_

const std::uint16_t CppIndent::initialLevel_
private

Definition at line 46 of file cppindent.h.

◆ type_

Type CppIndent::type_
private

Definition at line 47 of file cppindent.h.


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