4#ifndef QMLDOMOUTWRITER_P_H
5#define QMLDOMOUTWRITER_P_H
23#include <QtCore/QLoggingCategory>
50 bool indentNextlines =
false;
51 bool skipComments =
false;
67 if (indentNextlines && tt == LineWriter::TextAddType::Normal
78 int oldIndent = indent;
85 Q_ASSERT(expectedIndent < 0 || expectedIndent == indent);
91 void regionStart(
QString rName);
100 return writeRegion(rName.
toString(), toWrite);
136 lineWriter.
write(
v, toUpdate);
140 void eof(
bool ensureNewline =
true) { lineWriter.
eof(ensureNewline); }
152 if (
auto updExp = UpdatedScriptExpression::ensure(reformattedScriptExpressions,
p,
153 AttachedInfo::PathType::Canonical)) {
154 updExp->info().expr = exp;
Represents and maintains a mapping between elements and their location in a file.
std::shared_ptr< AttachedInfoT< FileLocations > > Tree
FormatOptions formatOptions
const QString & currentLine() const
LineWriter & write(QStringView v, TextAddType tType=TextAddType::Normal)
void addInnerSink(SinkF s)
LineWriter & ensureNewline(int nNewlines=1, TextAddType t=TextAddType::Extra)
LineWriter & ensureSpace(TextAddType t=TextAddType::Extra)
const LineWriterOptions & options() const
void eof(bool ensureNewline=true)
int addNewlinesAutospacerCallback(int nLines)
bool removeTextAddCallback(int i)
void setLineIndent(int indentAmount)
int addTextAddCallback(std::function< bool(LineWriter &, TextAddType)> callback)
QMap< QString, PendingSourceLocationId > pendingRegions
PendingSourceLocationId fullRegionId
FileLocations::Tree currentMap
QMap< QString, CommentedElement > pendingComments
OutWriter & ensureNewline(int nNewlines=1)
int increaseIndent(int level=1)
OutWriter & ensureSpace()
OutWriter & writeRegion(QString t)
QList< OutWriterState > states
OutWriter & writeRegion(QStringView rName, QStringView toWrite)
OutWriter & write(QStringView v, SourceLocation *toUpdate)
OutWriter & writeRegion(QStringView t)
int decreaseIndent(int level=1, int expectedIndent=-1)
OutWriter & ensureSpace(QStringView space)
OutWriter(LineWriter &lw)
void eof(bool ensureNewline=true)
UpdatedScriptExpression::Tree reformattedScriptExpressions
void regionStart(QStringView rName)
bool removeTextAddCallback(int i)
void regionEnd(QStringView rName)
FileLocations::Tree topLocation
int addNewlinesAutospacerCallback(int nLines)
int addTextAddCallback(std::function< bool(LineWriter &, LineWriter::TextAddType)> callback)
void addReformattedScriptExpression(Path p, std::shared_ptr< ScriptExpression > exp)
OutWriter & write(QStringView v, LineWriter::TextAddType t=LineWriter::TextAddType::Normal)
std::shared_ptr< AttachedInfoT< UpdatedScriptExpression > > Tree
constexpr bool isEmpty() const noexcept
Returns whether this string view is empty - that is, whether {size() == 0}.
QString toString() const
Returns a deep copy of this string view's data as a QString.
QStringView trimmed() const noexcept
Strips leading and trailing whitespace and returns the result.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString & append(QChar c)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
GLsizei const GLfloat * v
[13]
GLenum GLuint GLint level