MCPcopy Create free account
hub / github.com/apache/trafficserver / BlockSeqPrepareNode

Method BlockSeqPrepareNode

lib/yamlcpp/src/emitter.cpp:359–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359void Emitter::BlockSeqPrepareNode(EmitterNodeType::value child) {
360 const std::size_t curIndent = m_pState->CurIndent();
361 const std::size_t nextIndent = curIndent + m_pState->CurGroupIndent();
362
363 if (child == EmitterNodeType::NoType)
364 return;
365
366 if (!m_pState->HasBegunContent()) {
367 if (m_pState->CurGroupChildCount() > 0 || m_stream.comment()) {
368 m_stream << "\n";
369 }
370 m_stream << IndentTo(curIndent);
371 m_stream << "-";
372 }
373
374 switch (child) {
375 case EmitterNodeType::NoType:
376 break;
377 case EmitterNodeType::Property:
378 case EmitterNodeType::Scalar:
379 case EmitterNodeType::FlowSeq:
380 case EmitterNodeType::FlowMap:
381 SpaceOrIndentTo(m_pState->HasBegunContent(), nextIndent);
382 break;
383 case EmitterNodeType::BlockSeq:
384 m_stream << "\n";
385 break;
386 case EmitterNodeType::BlockMap:
387 if (m_pState->HasBegunContent() || m_stream.comment())
388 m_stream << "\n";
389 break;
390 }
391}
392
393void Emitter::FlowMapPrepareNode(EmitterNodeType::value child) {
394 if (m_pState->CurGroupChildCount() % 2 == 0) {

Callers

nothing calls this directly

Calls 5

IndentToClass · 0.85
CurIndentMethod · 0.80
CurGroupIndentMethod · 0.80
HasBegunContentMethod · 0.80
CurGroupChildCountMethod · 0.80

Tested by

no test coverage detected