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);
129 lineWriter.
write(
v, toUpdate);
133 void eof(
bool ensureNewline =
true) { lineWriter.
eof(ensureNewline); }
145 if (
auto updExp = UpdatedScriptExpression::ensure(reformattedScriptExpressions,
p,
146 AttachedInfo::PathType::Canonical)) {
147 updExp->info().expr = exp;
155 static void logScriptExprUpdateSkipped(
157 const std::shared_ptr<ScriptExpression> &formattedExpr);
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)
LineWriter & ensureNewline(int nNewlines=1, TextAddType t=TextAddType::Extra)
LineWriter & ensureSpace(TextAddType t=TextAddType::Extra)
const LineWriterOptions & options() const
void eof(bool ensureNewline=true)
void addInnerSink(const SinkF &s)
int addNewlinesAutospacerCallback(int nLines)
bool removeTextAddCallback(int i)
void setLineIndent(int indentAmount)
int addTextAddCallback(std::function< bool(LineWriter &, TextAddType)> callback)
QMap< FileLocationRegion, PendingSourceLocationId > pendingRegions
PendingSourceLocationId fullRegionId
QMap< FileLocationRegion, CommentedElement > pendingComments
FileLocations::Tree currentMap
OutWriter & ensureNewline(int nNewlines=1)
int increaseIndent(int level=1)
OutWriter & ensureSpace()
void addReformattedScriptExpression(const Path &p, const std::shared_ptr< ScriptExpression > &exp)
QList< OutWriterState > states
OutWriter & write(QStringView v, SourceLocation *toUpdate)
int decreaseIndent(int level=1, int expectedIndent=-1)
OutWriter & ensureSpace(QStringView space)
OutWriter(LineWriter &lw)
void eof(bool ensureNewline=true)
UpdatedScriptExpression::Tree reformattedScriptExpressions
bool removeTextAddCallback(int i)
FileLocations::Tree topLocation
int addNewlinesAutospacerCallback(int nLines)
int addTextAddCallback(std::function< bool(LineWriter &, LineWriter::TextAddType)> callback)
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}.
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
int PendingSourceLocationId
Combined button and popup list for selecting options.
GLsizei const GLfloat * v
[13]
GLenum GLuint GLint level