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

Public Member Functions

 FileWriter (const QString &fileName, TextToNodeMap *map)
 
void appendBackslashToLinesAfter (int bytes)
 adds backslashes to all lines of the part of the buffer after bytes bytes. More...
 
void appendNodeToStack (Model::Node *node)
 
int bytesWrittenSoFar ()
 returns the amount of bytes written to the buffer of this writer so far. More...
 
QString fileContents ()
 Flushes any remaining writes, appends an empty line to the end of the file, and returns the entire file text. More...
 
void finishLine ()
 
bool isAtStartOfLine () const
 
bool lastCharacterIsWhiteSpace () const
 
void popLastNodeFromStack ()
 
void write (const QString &str)
 
void writeEmptyLine ()
 

Private Member Functions

void flushPending ()
 
void mapUntil (int endLine, int endColumn)
 

Private Attributes

int currentColumn_ {}
 
int currentLine_ {}
 
QString fileName_
 
TextToNodeMapmap_ {}
 
QList< Model::Node * > nodeStack_
 
Model::NodependingNodeToMap_ {}
 
Span pendingSpanToMap_ {0, 0, 0, 0}
 
QString renderedFile_
 

Constructor & Destructor Documentation

◆ FileWriter()

Export::FileWriter::FileWriter ( const QString &  fileName,
TextToNodeMap map 
)

Member Function Documentation

◆ appendBackslashToLinesAfter()

void Export::FileWriter::appendBackslashToLinesAfter ( int  bytes)

adds backslashes to all lines of the part of the buffer after bytes bytes.

◆ appendNodeToStack()

void Export::FileWriter::appendNodeToStack ( Model::Node node)
inline

◆ bytesWrittenSoFar()

int Export::FileWriter::bytesWrittenSoFar ( )

returns the amount of bytes written to the buffer of this writer so far.

used to add backslashes to all lines of the buffer after this value when exporting C++ macros.

◆ fileContents()

QString Export::FileWriter::fileContents ( )

Flushes any remaining writes, appends an empty line to the end of the file, and returns the entire file text.

◆ finishLine()

void Export::FileWriter::finishLine ( )

◆ flushPending()

void Export::FileWriter::flushPending ( )
private

◆ isAtStartOfLine()

bool Export::FileWriter::isAtStartOfLine ( ) const
inline

◆ lastCharacterIsWhiteSpace()

bool Export::FileWriter::lastCharacterIsWhiteSpace ( ) const
inline

◆ mapUntil()

void Export::FileWriter::mapUntil ( int  endLine,
int  endColumn 
)
private

◆ popLastNodeFromStack()

void Export::FileWriter::popLastNodeFromStack ( )
inline

◆ write()

void Export::FileWriter::write ( const QString &  str)

◆ writeEmptyLine()

void Export::FileWriter::writeEmptyLine ( )

Member Data Documentation

◆ currentColumn_

int Export::FileWriter::currentColumn_ {}
private

◆ currentLine_

int Export::FileWriter::currentLine_ {}
private

◆ fileName_

QString Export::FileWriter::fileName_
private

◆ map_

TextToNodeMap* Export::FileWriter::map_ {}
private

◆ nodeStack_

QList<Model::Node*> Export::FileWriter::nodeStack_
private

◆ pendingNodeToMap_

Model::Node* Export::FileWriter::pendingNodeToMap_ {}
private

◆ pendingSpanToMap_

Span Export::FileWriter::pendingSpanToMap_ {0, 0, 0, 0}
private

◆ renderedFile_

QString Export::FileWriter::renderedFile_
private