Support kinds of emitter format-setting for YAML::Null. (#906)

* Support kinds of emitter format-setting for YAML::Null.

* update the code and test cases

* add the comment //fallthrough
This commit is contained in:
Chen
2020-06-29 12:31:53 +08:00
committed by GitHub
parent 27d8a0e302
commit 08aa252611
7 changed files with 86 additions and 1 deletions

View File

@@ -50,6 +50,7 @@ class YAML_CPP_API Emitter {
bool SetOutputCharset(EMITTER_MANIP value);
bool SetStringFormat(EMITTER_MANIP value);
bool SetBoolFormat(EMITTER_MANIP value);
bool SetNullFormat(EMITTER_MANIP value);
bool SetIntBase(EMITTER_MANIP value);
bool SetSeqFormat(EMITTER_MANIP value);
bool SetMapFormat(EMITTER_MANIP value);
@@ -123,6 +124,7 @@ class YAML_CPP_API Emitter {
void SpaceOrIndentTo(bool requireSpace, std::size_t indent);
const char* ComputeFullBoolName(bool b) const;
const char* ComputeNullName() const;
bool CanEmitNewline() const;
private:

View File

@@ -26,6 +26,12 @@ enum EMITTER_MANIP {
DoubleQuoted,
Literal,
// null manipulators
LowerNull,
UpperNull,
CamelNull,
TildeNull,
// bool manipulators
YesNoBool, // yes, no
TrueFalseBool, // true, false