Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
Export::FragmentLayouter Class Reference

Public Types

enum  IndentationFlag { NoIndentation = 0x0 , NewLineBefore = 0x1 , IndentPrePostFix = 0x2 , IndentChildFragments = 0x4 , SpaceAfterPrefix = 0x8 , NewLineAfterPrefix = 0x10 , SpaceBeforePostfix = 0x20 , NewLineBeforePostfix = 0x40 , NewLineAfterPostfix = 0x80 , SpaceBeforeSeparator = 0x100 , SpaceAfterSeparator = 0x200 , EmptyLineAtEnd = 0x400 , SpaceAtEnd = 0x800 , BackslashAfterLines = 0x1000 }
 
using IndentationFlags = QFlags< IndentationFlag >
 

Public Member Functions

 FragmentLayouter (const QString &indentation)
 
void addRule (const QString &fragmentType, IndentationFlags parameters, const QString &prefix={}, const QString &separator={}, const QString &postfix={})
 
QString render (SourceFile *file, TextToNodeMap *map)
 

Private Member Functions

void render (SourceFragment *fragment, QString indentationSoFar)
 

Private Attributes

QString indentation_
 
QHash< QString, QPair< IndentationFlags, FragmentDecoration > > rules_
 
FileWriterwriter_ {}
 

Member Typedef Documentation

◆ IndentationFlags

Member Enumeration Documentation

◆ IndentationFlag

Enumerator
NoIndentation 
NewLineBefore 
IndentPrePostFix 
IndentChildFragments 
SpaceAfterPrefix 
NewLineAfterPrefix 
SpaceBeforePostfix 
NewLineBeforePostfix 
NewLineAfterPostfix 
SpaceBeforeSeparator 
SpaceAfterSeparator 
EmptyLineAtEnd 
SpaceAtEnd 
BackslashAfterLines 

Constructor & Destructor Documentation

◆ FragmentLayouter()

Export::FragmentLayouter::FragmentLayouter ( const QString &  indentation)

Member Function Documentation

◆ addRule()

void Export::FragmentLayouter::addRule ( const QString &  fragmentType,
IndentationFlags  parameters,
const QString &  prefix = {},
const QString &  separator = {},
const QString &  postfix = {} 
)

◆ render() [1/2]

QString Export::FragmentLayouter::render ( SourceFile file,
TextToNodeMap map 
)

◆ render() [2/2]

void Export::FragmentLayouter::render ( SourceFragment fragment,
QString  indentationSoFar 
)
private

Member Data Documentation

◆ indentation_

QString Export::FragmentLayouter::indentation_
private

◆ rules_

QHash<QString, QPair<IndentationFlags, FragmentDecoration> > Export::FragmentLayouter::rules_
private

◆ writer_

FileWriter* Export::FragmentLayouter::writer_ {}
private