Forced literal scalars to use long keys

This commit is contained in:
Jesse Beder
2012-05-22 15:07:11 -05:00
parent cdfbac1fd7
commit faa2e50605

View File

@@ -536,11 +536,14 @@ namespace YAML
if(!good())
return *this;
PrepareNode(EmitterNodeType::Scalar);
const bool escapeNonAscii = m_pState->GetOutputCharset() == EscapeNonAscii;
const StringFormat::value strFormat = Utils::ComputeStringFormat(str, m_pState->GetStringFormat(), m_pState->CurGroupFlowType(), escapeNonAscii);
if(strFormat == StringFormat::Literal)
m_pState->SetMapKeyFormat(YAML::LongKey, FmtScope::Local);
PrepareNode(EmitterNodeType::Scalar);
switch(strFormat) {
case StringFormat::Plain:
m_stream << str;