mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Split block map simple/long key for both key/value
This commit is contained in:
@@ -58,12 +58,26 @@ namespace YAML
|
||||
m_hasNonContent = true;
|
||||
}
|
||||
|
||||
void EmitterState::SetLongKey()
|
||||
{
|
||||
assert(!m_groups.empty());
|
||||
if(m_groups.empty())
|
||||
return;
|
||||
|
||||
assert(m_groups.top().type == GroupType::Map);
|
||||
assert(m_groups.top().flowType == FlowType::Block);
|
||||
m_groups.top().longKey = true;
|
||||
}
|
||||
|
||||
void EmitterState::StartedNode()
|
||||
{
|
||||
if(m_groups.empty())
|
||||
if(m_groups.empty()) {
|
||||
m_docCount++;
|
||||
else
|
||||
} else {
|
||||
m_groups.top().childCount++;
|
||||
if(m_groups.top().childCount % 2 == 0)
|
||||
m_groups.top().longKey = false;
|
||||
}
|
||||
|
||||
m_hasAnchor = false;
|
||||
m_hasTag = false;
|
||||
@@ -166,6 +180,11 @@ namespace YAML
|
||||
return m_groups.empty() ? m_docCount : m_groups.top().childCount;
|
||||
}
|
||||
|
||||
bool EmitterState::CurGroupLongKey() const
|
||||
{
|
||||
return m_groups.empty() ? false : m_groups.top().longKey;
|
||||
}
|
||||
|
||||
void EmitterState::ClearModifiedSettings()
|
||||
{
|
||||
m_modifiedSettings.clear();
|
||||
|
Reference in New Issue
Block a user