forked from lix-project/lix
prettyPrint
-> shouldPrettyPrint
(cherry picked from commit 1c5f5d4291df7bf80806e57c75d2ec67bced8616)
Change-Id: I7a517490e7baa5cef00716f6d6cfcbcbcdde11bf
This commit is contained in:
parent
4dabde0485
commit
73cdaf44cf
2 changed files with 5 additions and 5 deletions
|
@ -71,7 +71,7 @@ struct PrintOptions
|
||||||
/**
|
/**
|
||||||
* True if pretty-printing is enabled.
|
* True if pretty-printing is enabled.
|
||||||
*/
|
*/
|
||||||
inline bool prettyPrint()
|
inline bool shouldPrettyPrint()
|
||||||
{
|
{
|
||||||
return prettyIndent > 0;
|
return prettyIndent > 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,14 +166,14 @@ private:
|
||||||
|
|
||||||
void increaseIndent()
|
void increaseIndent()
|
||||||
{
|
{
|
||||||
if (options.prettyPrint()) {
|
if (options.shouldPrettyPrint()) {
|
||||||
indent.append(options.prettyIndent, ' ');
|
indent.append(options.prettyIndent, ' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void decreaseIndent()
|
void decreaseIndent()
|
||||||
{
|
{
|
||||||
if (options.prettyPrint()) {
|
if (options.shouldPrettyPrint()) {
|
||||||
assert(indent.size() >= options.prettyIndent);
|
assert(indent.size() >= options.prettyIndent);
|
||||||
indent.resize(indent.size() - options.prettyIndent);
|
indent.resize(indent.size() - options.prettyIndent);
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,7 @@ private:
|
||||||
|
|
||||||
bool shouldPrettyPrintAttrs(AttrVec & v)
|
bool shouldPrettyPrintAttrs(AttrVec & v)
|
||||||
{
|
{
|
||||||
if (!options.prettyPrint() || v.empty()) {
|
if (!options.shouldPrettyPrint() || v.empty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ private:
|
||||||
|
|
||||||
bool shouldPrettyPrintList(std::span<Value * const> list)
|
bool shouldPrettyPrintList(std::span<Value * const> list)
|
||||||
{
|
{
|
||||||
if (!options.prettyPrint() || list.empty()) {
|
if (!options.shouldPrettyPrint() || list.empty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue