mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Added long key flow map
This commit is contained in:
@@ -422,10 +422,59 @@ namespace YAML
|
|||||||
|
|
||||||
void Emitter::FlowMapPrepareLongKey(EmitterNodeType::value child)
|
void Emitter::FlowMapPrepareLongKey(EmitterNodeType::value child)
|
||||||
{
|
{
|
||||||
|
const unsigned lastIndent = m_pState->LastIndent();
|
||||||
|
|
||||||
|
if(!m_pState->HasBegunNode()) {
|
||||||
|
if(m_stream.comment())
|
||||||
|
m_stream << "\n";
|
||||||
|
m_stream << IndentTo(lastIndent);
|
||||||
|
if(m_pState->CurGroupChildCount() == 0)
|
||||||
|
m_stream << "{ ?";
|
||||||
|
else
|
||||||
|
m_stream << ", ?";
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(child) {
|
||||||
|
case EmitterNodeType::None:
|
||||||
|
break;
|
||||||
|
case EmitterNodeType::Property:
|
||||||
|
case EmitterNodeType::Scalar:
|
||||||
|
case EmitterNodeType::FlowSeq:
|
||||||
|
case EmitterNodeType::FlowMap:
|
||||||
|
SpaceOrIndentTo(m_pState->HasBegunContent() || m_pState->CurGroupChildCount() > 0, lastIndent);
|
||||||
|
break;
|
||||||
|
case EmitterNodeType::BlockSeq:
|
||||||
|
case EmitterNodeType::BlockMap:
|
||||||
|
assert(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Emitter::FlowMapPrepareLongKeyValue(EmitterNodeType::value child)
|
void Emitter::FlowMapPrepareLongKeyValue(EmitterNodeType::value child)
|
||||||
{
|
{
|
||||||
|
const unsigned lastIndent = m_pState->LastIndent();
|
||||||
|
|
||||||
|
if(!m_pState->HasBegunNode()) {
|
||||||
|
if(m_stream.comment())
|
||||||
|
m_stream << "\n";
|
||||||
|
m_stream << IndentTo(lastIndent);
|
||||||
|
m_stream << ":";
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(child) {
|
||||||
|
case EmitterNodeType::None:
|
||||||
|
break;
|
||||||
|
case EmitterNodeType::Property:
|
||||||
|
case EmitterNodeType::Scalar:
|
||||||
|
case EmitterNodeType::FlowSeq:
|
||||||
|
case EmitterNodeType::FlowMap:
|
||||||
|
SpaceOrIndentTo(m_pState->HasBegunContent() || m_pState->CurGroupChildCount() > 0, lastIndent);
|
||||||
|
break;
|
||||||
|
case EmitterNodeType::BlockSeq:
|
||||||
|
case EmitterNodeType::BlockMap:
|
||||||
|
assert(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Emitter::FlowMapPrepareSimpleKey(EmitterNodeType::value child)
|
void Emitter::FlowMapPrepareSimpleKey(EmitterNodeType::value child)
|
||||||
|
Reference in New Issue
Block a user