Merged the other-tags branch into the trunk (this wasn't an rX:Y merge, since the branch wasn't branched directly from the head of the trunk)

This commit is contained in:
jbeder
2010-10-19 06:46:55 +00:00
parent 59d126f5b0
commit 973ce78fe1
8 changed files with 64 additions and 21 deletions

View File

@@ -120,6 +120,9 @@ namespace YAML
case Value:
EmitValue();
break;
case TagByKind:
EmitKindTag();
break;
default:
m_pState->SetLocalValue(value);
break;
@@ -651,15 +654,26 @@ namespace YAML
if(!good())
return *this;
EmitTag(tag.verbatim, tag);
return *this;
}
void Emitter::EmitTag(bool verbatim, const _Tag& tag)
{
PreAtomicWrite();
EmitSeparationIfNecessary();
if(!Utils::WriteTag(m_stream, tag.content)) {
if(!Utils::WriteTag(m_stream, tag.content, verbatim)) {
m_pState->SetError(ErrorMsg::INVALID_TAG);
return *this;
return;
}
m_pState->RequireSeparation();
// Note: no PostAtomicWrite() because we need another value for this node
return *this;
}
void Emitter::EmitKindTag()
{
_Tag tag("");
EmitTag(false, tag);
}
Emitter& Emitter::Write(const _Comment& comment)