Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QQmlJS::Dom::OutWriter Class Reference

#include <qqmldomoutwriter_p.h>

+ Collaboration diagram for QQmlJS::Dom::OutWriter:

Public Member Functions

 OutWriter (LineWriter &lw)
 
OutWriterStatestate (int i=0)
 
int increaseIndent (int level=1)
 
int decreaseIndent (int level=1, int expectedIndent=-1)
 
void itemStart (DomItem &it)
 
void itemEnd (DomItem &it)
 
void regionStart (QString rName)
 
void regionStart (QStringView rName)
 
void regionEnd (QString rName)
 
void regionEnd (QStringView rName)
 
quint32 counter () const
 
OutWriterwriteRegion (QString rName, QStringView toWrite)
 
OutWriterwriteRegion (QStringView rName, QStringView toWrite)
 
OutWriterwriteRegion (QString t)
 
OutWriterwriteRegion (QStringView t)
 
OutWriterensureNewline (int nNewlines=1)
 
OutWriterensureSpace ()
 
OutWriterensureSpace (QStringView space)
 
OutWriternewline ()
 
OutWriterspace ()
 
OutWriterwrite (QStringView v, LineWriter::TextAddType t=LineWriter::TextAddType::Normal)
 
OutWriterwrite (QStringView v, SourceLocation *toUpdate)
 
void flush ()
 
void eof (bool ensureNewline=true)
 
int addNewlinesAutospacerCallback (int nLines)
 
int addTextAddCallback (std::function< bool(LineWriter &, LineWriter::TextAddType)> callback)
 
bool removeTextAddCallback (int i)
 
void addReformattedScriptExpression (Path p, std::shared_ptr< ScriptExpression > exp)
 
DomItem updatedFile (DomItem &qmlFile)
 

Public Attributes

int indent = 0
 
int indenterId = -1
 
bool indentNextlines = false
 
bool skipComments = false
 
LineWriterlineWriter
 
Path currentPath
 
FileLocations::Tree topLocation
 
QString writtenStr
 
UpdatedScriptExpression::Tree reformattedScriptExpressions
 
QList< OutWriterStatestates
 

Detailed Description

Definition at line 45 of file qqmldomoutwriter_p.h.

Constructor & Destructor Documentation

◆ OutWriter()

QQmlJS::Dom::OutWriter::OutWriter ( LineWriter lw)
inlineexplicit

Definition at line 59 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriter::addInnerSink(), QQmlJS::Dom::LineWriter::addTextAddCallback(), QString::append(), QQmlJS::Dom::LineWriter::currentLine(), QStringView::isEmpty(), QQmlJS::Dom::LineWriter::setLineIndent(), and QStringView::trimmed().

+ Here is the call graph for this function:

Member Function Documentation

◆ addNewlinesAutospacerCallback()

int QQmlJS::Dom::OutWriter::addNewlinesAutospacerCallback ( int  nLines)
inline

Definition at line 141 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriter::addNewlinesAutospacerCallback().

+ Here is the call graph for this function:

◆ addReformattedScriptExpression()

void QQmlJS::Dom::OutWriter::addReformattedScriptExpression ( Path  p,
std::shared_ptr< ScriptExpression exp 
)
inline

Definition at line 150 of file qqmldomoutwriter_p.h.

◆ addTextAddCallback()

int QQmlJS::Dom::OutWriter::addTextAddCallback ( std::function< bool(LineWriter &, LineWriter::TextAddType)>  callback)
inline

Definition at line 145 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriter::addTextAddCallback().

+ Here is the call graph for this function:

◆ counter()

quint32 QQmlJS::Dom::OutWriter::counter ( ) const
inline

Definition at line 96 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriter::counter().

+ Here is the call graph for this function:

◆ decreaseIndent()

int QQmlJS::Dom::OutWriter::decreaseIndent ( int  level = 1,
int  expectedIndent = -1 
)
inline

Definition at line 82 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriterOptions::formatOptions, QQmlJS::Dom::FormatOptions::indentSize, QQmlJS::Dom::LineWriter::options(), and Q_ASSERT.

Referenced by QQmlJS::Dom::Rewriter::lnAcceptIndented(), QQmlJS::Dom::Rewriter::visit(), QQmlJS::Dom::Rewriter::visit(), QQmlJS::Dom::Rewriter::visit(), QQmlJS::Dom::Rewriter::visit(), QQmlJS::Dom::Rewriter::visit(), and QQmlJS::Dom::Rewriter::visit().

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

◆ ensureNewline()

OutWriter & QQmlJS::Dom::OutWriter::ensureNewline ( int  nNewlines = 1)
inline

Definition at line 104 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriter::ensureNewline().

Referenced by QQmlJS::Dom::Rewriter::lnAcceptIndented(), QQmlJS::Dom::Rewriter::newLine(), QQmlJS::Dom::Comment::write(), QQmlJS::Dom::QmlComponent::writeOut(), and QQmlJS::Dom::QmlFile::writeOut().

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

◆ ensureSpace() [1/2]

OutWriter & QQmlJS::Dom::OutWriter::ensureSpace ( )
inline

Definition at line 109 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriter::ensureSpace().

Referenced by QQmlJS::Dom::Comment::write().

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

◆ ensureSpace() [2/2]

OutWriter & QQmlJS::Dom::OutWriter::ensureSpace ( QStringView  space)
inline

Definition at line 114 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriter::ensureSpace().

+ Here is the call graph for this function:

◆ eof()

void QQmlJS::Dom::OutWriter::eof ( bool  ensureNewline = true)
inline

Definition at line 140 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriter::eof().

+ Here is the call graph for this function:

◆ flush()

void QQmlJS::Dom::OutWriter::flush ( )
inline

Definition at line 139 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriter::flush().

+ Here is the call graph for this function:

◆ increaseIndent()

int QQmlJS::Dom::OutWriter::increaseIndent ( int  level = 1)
inline

Definition at line 76 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriterOptions::formatOptions, QQmlJS::Dom::FormatOptions::indentSize, and QQmlJS::Dom::LineWriter::options().

Referenced by QQmlJS::Dom::Rewriter::lnAcceptIndented(), QQmlJS::Dom::Rewriter::visit(), QQmlJS::Dom::Rewriter::visit(), QQmlJS::Dom::Rewriter::visit(), QQmlJS::Dom::Rewriter::visit(), QQmlJS::Dom::Rewriter::visit(), and QQmlJS::Dom::Rewriter::visit().

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

◆ itemEnd()

void QQmlJS::Dom::OutWriter::itemEnd ( DomItem it)

Definition at line 80 of file qqmldomoutwriter.cpp.

References it, item, Q_ASSERT, regionEnd(), and state.

+ Here is the call graph for this function:

◆ itemStart()

◆ newline()

OutWriter & QQmlJS::Dom::OutWriter::newline ( )
inline

Definition at line 119 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriter::newline().

Referenced by QQmlJS::Dom::Rewriter::visit().

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

◆ regionEnd() [1/2]

void QQmlJS::Dom::OutWriter::regionEnd ( QString  rName)

Definition at line 103 of file qqmldomoutwriter.cpp.

References QQmlJS::Dom::LineWriter::endSourceLocation(), lineWriter, QQmlJS::Dom::LineWriterOptions::Locations, QQmlJS::Dom::LineWriter::options(), Q_ASSERT, skipComments, state, and QQmlJS::Dom::LineWriterOptions::updateOptions.

Referenced by itemEnd(), and writeRegion().

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

◆ regionEnd() [2/2]

void QQmlJS::Dom::OutWriter::regionEnd ( QStringView  rName)
inline

Definition at line 94 of file qqmldomoutwriter_p.h.

References regionEnd(), and QStringView::toString().

Referenced by regionEnd().

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

◆ regionStart() [1/2]

void QQmlJS::Dom::OutWriter::regionStart ( QString  rName)

Definition at line 89 of file qqmldomoutwriter.cpp.

References QQmlJS::Dom::FileLocations::addRegion(), lineWriter, QQmlJS::Dom::LineWriterOptions::Locations, QQmlJS::Dom::LineWriter::options(), Q_ASSERT, skipComments, QQmlJS::Dom::LineWriter::startSourceLocation(), state, and QQmlJS::Dom::LineWriterOptions::updateOptions.

Referenced by itemStart(), and writeRegion().

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

◆ regionStart() [2/2]

void QQmlJS::Dom::OutWriter::regionStart ( QStringView  rName)
inline

Definition at line 92 of file qqmldomoutwriter_p.h.

References regionStart(), and QStringView::toString().

Referenced by regionStart().

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

◆ removeTextAddCallback()

bool QQmlJS::Dom::OutWriter::removeTextAddCallback ( int  i)
inline

Definition at line 149 of file qqmldomoutwriter_p.h.

References i, and QQmlJS::Dom::LineWriter::removeTextAddCallback().

+ Here is the call graph for this function:

◆ space()

OutWriter & QQmlJS::Dom::OutWriter::space ( )
inline

Definition at line 124 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriter::space().

Referenced by QQmlJS::Dom::QmlComponent::writeOut().

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

◆ state()

OutWriterState & QQmlJS::Dom::OutWriter::state ( int  i = 0)

Definition at line 48 of file qqmldomoutwriter.cpp.

References i.

◆ updatedFile()

◆ write() [1/2]

OutWriter & QQmlJS::Dom::OutWriter::write ( QStringView  v,
LineWriter::TextAddType  t = LineWriter::TextAddType::Normal 
)
inline

Definition at line 129 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriter::write().

Referenced by QQmlJS::Dom::Rewriter::out(), QQmlJS::Dom::Rewriter::out(), and QQmlJS::Dom::Comment::write().

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

◆ write() [2/2]

OutWriter & QQmlJS::Dom::OutWriter::write ( QStringView  v,
SourceLocation toUpdate 
)
inline

Definition at line 134 of file qqmldomoutwriter_p.h.

References QQmlJS::Dom::LineWriter::write().

+ Here is the call graph for this function:

◆ writeRegion() [1/4]

OutWriter & QQmlJS::Dom::OutWriter::writeRegion ( QString  rName,
QStringView  toWrite 
)

Definition at line 121 of file qqmldomoutwriter.cpp.

References lineWriter, regionEnd(), regionStart(), and QQmlJS::Dom::LineWriter::write().

Referenced by QQmlJS::Dom::QmlComponent::writeOut().

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

◆ writeRegion() [2/4]

OutWriter & QQmlJS::Dom::OutWriter::writeRegion ( QString  t)
inline

Definition at line 102 of file qqmldomoutwriter_p.h.

References writeRegion().

Referenced by writeRegion().

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

◆ writeRegion() [3/4]

OutWriter & QQmlJS::Dom::OutWriter::writeRegion ( QStringView  rName,
QStringView  toWrite 
)
inline

Definition at line 98 of file qqmldomoutwriter_p.h.

References QStringView::toString().

+ Here is the call graph for this function:

◆ writeRegion() [4/4]

OutWriter & QQmlJS::Dom::OutWriter::writeRegion ( QStringView  t)
inline

Definition at line 103 of file qqmldomoutwriter_p.h.

References writeRegion().

Referenced by writeRegion().

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

Member Data Documentation

◆ currentPath

Path QQmlJS::Dom::OutWriter::currentPath

Definition at line 53 of file qqmldomoutwriter_p.h.

◆ indent

int QQmlJS::Dom::OutWriter::indent = 0

Definition at line 48 of file qqmldomoutwriter_p.h.

◆ indenterId

int QQmlJS::Dom::OutWriter::indenterId = -1

Definition at line 49 of file qqmldomoutwriter_p.h.

◆ indentNextlines

bool QQmlJS::Dom::OutWriter::indentNextlines = false

◆ lineWriter

LineWriter& QQmlJS::Dom::OutWriter::lineWriter

◆ reformattedScriptExpressions

UpdatedScriptExpression::Tree QQmlJS::Dom::OutWriter::reformattedScriptExpressions

Definition at line 56 of file qqmldomoutwriter_p.h.

Referenced by updatedFile().

◆ skipComments

bool QQmlJS::Dom::OutWriter::skipComments = false

Definition at line 51 of file qqmldomoutwriter_p.h.

Referenced by regionEnd(), and regionStart().

◆ states

QList<OutWriterState> QQmlJS::Dom::OutWriter::states

Definition at line 57 of file qqmldomoutwriter_p.h.

◆ topLocation

FileLocations::Tree QQmlJS::Dom::OutWriter::topLocation

Definition at line 54 of file qqmldomoutwriter_p.h.

Referenced by itemStart(), and updatedFile().

◆ writtenStr

QString QQmlJS::Dom::OutWriter::writtenStr

Definition at line 55 of file qqmldomoutwriter_p.h.


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