diff options
author | innokentii <innokentii@yandex-team.com> | 2023-04-13 17:48:21 +0300 |
---|---|---|
committer | innokentii <innokentii@yandex-team.com> | 2023-04-13 17:48:21 +0300 |
commit | 15d3532f49b3662c9ca277db63052de97e7ed735 (patch) | |
tree | 851e2dd27c3736bb59970503ef571ac779c84fdd /library/cpp/yaml/fyamlcpp/fyamlcpp.cpp | |
parent | edbc6cad1fc50b1237b88cd16a78fd44777a6601 (diff) | |
download | ydb-15d3532f49b3662c9ca277db63052de97e7ed735.tar.gz |
Forward libfyaml node styles to fyamlcpp
forward libfyaml node styles to fyamlcpp
Diffstat (limited to 'library/cpp/yaml/fyamlcpp/fyamlcpp.cpp')
-rw-r--r-- | library/cpp/yaml/fyamlcpp/fyamlcpp.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/library/cpp/yaml/fyamlcpp/fyamlcpp.cpp b/library/cpp/yaml/fyamlcpp/fyamlcpp.cpp index b8d8b17596..9ddf434e97 100644 --- a/library/cpp/yaml/fyamlcpp/fyamlcpp.cpp +++ b/library/cpp/yaml/fyamlcpp/fyamlcpp.cpp @@ -155,18 +155,6 @@ enum EEmitterCfgFlags { Default = FYECF_DEFAULT, }; -enum class ENodeStyle { - Any = FYNS_ANY, - Flow = FYNS_FLOW, - Block = FYNS_BLOCK, - Plain = FYNS_PLAIN, - SingleQuoted = FYNS_SINGLE_QUOTED, - DoubleQuoted = FYNS_DOUBLE_QUOTED, - Literal = FYNS_LITERAL, - Folded = FYNS_FOLDED, - Alias = FYNS_ALIAS, -}; - enum class ENodeWalkFlags { DontFollow = FYNWF_DONT_FOLLOW, Follow = FYNWF_FOLLOW, @@ -400,6 +388,16 @@ std::unique_ptr<char, void(*)(char*)> TNodeRef::EmitToCharArray() const { return res; } +void TNodeRef::SetStyle(ENodeStyle style) { + ENSURE_NODE_NOT_EMPTY(Node_); + fy_node_set_style(Node_, (enum fy_node_style)style); +} + +ENodeStyle TNodeRef::Style() const { + ENSURE_NODE_NOT_EMPTY(Node_); + return (ENodeStyle)fy_node_get_style(Node_); +} + void TNodeRef::SetUserData(NDetail::IBasicUserData* data) { ENSURE_NODE_NOT_EMPTY(Node_); fy_node_set_meta(Node_, data); @@ -819,7 +817,7 @@ std::unique_ptr<char, void(*)(char*)> TDocument::EmitToCharArray() const { std::unique_ptr<char, void(*)(char*)> res( fy_emit_document_to_string( Document_.get(), - (fy_emitter_cfg_flags)(FYECF_DEFAULT | FYECF_OUTPUT_COMMENTS)), &NDetail::FreeChar); + (fy_emitter_cfg_flags)(FYECF_DEFAULT | FYECF_MODE_PRETTY | FYECF_OUTPUT_COMMENTS)), &NDetail::FreeChar); return res; } |