clang format changes

This commit is contained in:
hyperxor 2020-02-15 08:56:00 +03:00
parent 3f14b084ff
commit 76e4c33345
4 changed files with 18 additions and 44 deletions

View File

@ -89,8 +89,7 @@ void EmitterState::StartedNode() {
m_hasNonContent = false;
}
EmitterNodeType::value EmitterState::NextGroupType(
GroupType type) const {
EmitterNodeType::value EmitterState::NextGroupType(GroupType type) const {
if (type == GroupType::Seq) {
if (GetFlowType(type) == Block)
return EmitterNodeType::BlockSeq;
@ -220,8 +219,7 @@ std::size_t EmitterState::LastIndent() const {
void EmitterState::ClearModifiedSettings() { m_modifiedSettings.clear(); }
bool EmitterState::SetOutputCharset(EMITTER_MANIP value,
FmtScope scope) {
bool EmitterState::SetOutputCharset(EMITTER_MANIP value, FmtScope scope) {
switch (value) {
case EmitNonAscii:
case EscapeNonAscii:
@ -257,8 +255,7 @@ bool EmitterState::SetBoolFormat(EMITTER_MANIP value, FmtScope scope) {
}
}
bool EmitterState::SetBoolLengthFormat(EMITTER_MANIP value,
FmtScope scope) {
bool EmitterState::SetBoolLengthFormat(EMITTER_MANIP value, FmtScope scope) {
switch (value) {
case LongBool:
case ShortBool:
@ -269,8 +266,7 @@ bool EmitterState::SetBoolLengthFormat(EMITTER_MANIP value,
}
}
bool EmitterState::SetBoolCaseFormat(EMITTER_MANIP value,
FmtScope scope) {
bool EmitterState::SetBoolCaseFormat(EMITTER_MANIP value, FmtScope scope) {
switch (value) {
case UpperCase:
case LowerCase:
@ -302,8 +298,7 @@ bool EmitterState::SetIndent(std::size_t value, FmtScope scope) {
return true;
}
bool EmitterState::SetPreCommentIndent(std::size_t value,
FmtScope scope) {
bool EmitterState::SetPreCommentIndent(std::size_t value, FmtScope scope) {
if (value == 0)
return false;
@ -311,8 +306,7 @@ bool EmitterState::SetPreCommentIndent(std::size_t value,
return true;
}
bool EmitterState::SetPostCommentIndent(std::size_t value,
FmtScope scope) {
bool EmitterState::SetPostCommentIndent(std::size_t value, FmtScope scope) {
if (value == 0)
return false;
@ -359,8 +353,7 @@ bool EmitterState::SetFloatPrecision(std::size_t value, FmtScope scope) {
return true;
}
bool EmitterState::SetDoublePrecision(std::size_t value,
FmtScope scope) {
bool EmitterState::SetDoublePrecision(std::size_t value, FmtScope scope) {
if (value > std::numeric_limits<double>::max_digits10)
return false;
_Set(m_doublePrecision, value, scope);

View File

@ -18,22 +18,11 @@
#include <vector>
namespace YAML {
enum class FmtScope {
Local,
Global
};
enum class FmtScope { Local, Global };
enum class GroupType {
NoType,
Seq,
Map
};
enum class GroupType { NoType, Seq, Map };
enum class FlowType {
NoType,
Flow,
Block
};
enum class FlowType { NoType, Flow, Block };
class EmitterState {
public:
@ -109,8 +98,7 @@ class EmitterState {
bool SetPostCommentIndent(std::size_t value, FmtScope scope);
std::size_t GetPostCommentIndent() const { return m_postCommentIndent.get(); }
bool SetFlowType(GroupType groupType, EMITTER_MANIP value,
FmtScope scope);
bool SetFlowType(GroupType groupType, EMITTER_MANIP value, FmtScope scope);
EMITTER_MANIP GetFlowType(GroupType groupType) const;
bool SetMapKeyFormat(EMITTER_MANIP value, FmtScope scope);

View File

@ -261,9 +261,8 @@ bool WriteAliasName(ostream_wrapper& out, const std::string& str) {
} // namespace
StringFormat ComputeStringFormat(const std::string& str,
EMITTER_MANIP strFormat,
FlowType flowType,
bool escapeNonAscii) {
EMITTER_MANIP strFormat, FlowType flowType,
bool escapeNonAscii) {
switch (strFormat) {
case Auto:
if (IsValidPlainScalar(str, flowType, escapeNonAscii)) {

View File

@ -20,18 +20,12 @@ class ostream_wrapper;
namespace YAML {
class Binary;
enum class StringFormat {
Plain,
SingleQuoted,
DoubleQuoted,
Literal
};
enum class StringFormat { Plain, SingleQuoted, DoubleQuoted, Literal };
namespace Utils {
StringFormat ComputeStringFormat(const std::string& str,
EMITTER_MANIP strFormat,
FlowType flowType,
bool escapeNonAscii);
EMITTER_MANIP strFormat, FlowType flowType,
bool escapeNonAscii);
bool WriteSingleQuotedString(ostream_wrapper& out, const std::string& str);
bool WriteDoubleQuotedString(ostream_wrapper& out, const std::string& str,
@ -47,7 +41,7 @@ bool WriteTag(ostream_wrapper& out, const std::string& str, bool verbatim);
bool WriteTagWithPrefix(ostream_wrapper& out, const std::string& prefix,
const std::string& tag);
bool WriteBinary(ostream_wrapper& out, const Binary& binary);
}
}
} // namespace Utils
} // namespace YAML
#endif // EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66