Holds state that is used when emitting a stream.
 /// <summary>
 /// Saves the current node to the specified emitter.
 /// </summary>
 /// <param name="emitter">The emitter where the node is to be saved.</param>
 /// <param name="state">The state.</param>
 internal override void Emit(IEmitter emitter, EmitterState state)
 {
     emitter.Emit(new MappingStart(Anchor, Tag, true, Style));
     foreach (var entry in children)
     {
         entry.Key.Save(emitter, state);
         entry.Value.Save(emitter, state);
     }
     emitter.Emit(new MappingEnd());
 }
Example #2
0
 /// <summary>
 /// Saves the current node to the specified emitter.
 /// </summary>
 /// <param name="emitter">The emitter where the node is to be saved.</param>
 /// <param name="state">The state.</param>
 internal void Save(IEmitter emitter, EmitterState state)
 {
     if (!string.IsNullOrEmpty(Anchor) && !state.EmittedAnchors.Add(Anchor))
     {
         emitter.Emit(new AnchorAlias(Anchor));
     }
     else
     {
         Emit(emitter, state);
     }
 }
Example #3
0
 /// <summary>
 /// Saves the current node to the specified emitter.
 /// </summary>
 /// <param name="emitter">The emitter where the node is to be saved.</param>
 /// <param name="state">The state.</param>
 internal void Save(IEmitter emitter, EmitterState state)
 {
     if (!Anchor.IsEmpty && !state.EmittedAnchors.Add(Anchor))
     {
         emitter.Emit(new AnchorAlias(Anchor));
     }
     else
     {
         Emit(emitter, state);
     }
 }
Example #4
0
 /// <summary>
 /// Saves the current node to the specified emitter.
 /// </summary>
 /// <param name="emitter">The emitter where the node is to be saved.</param>
 /// <param name="state">The state.</param>
 internal override void Emit(IEmitter emitter, EmitterState state)
 {
     emitter.Emit(new Scalar(Anchor, Tag, Value, Style, true, false));
 }
Example #5
0
 /// <summary>
 /// Saves the current node to the specified emitter.
 /// </summary>
 /// <param name="emitter">The emitter where the node is to be saved.</param>
 /// <param name="state">The state.</param>
 internal void Save(IEmitter emitter, EmitterState state)
 {
     if (!string.IsNullOrEmpty(Anchor) && !state.EmittedAnchors.Add(Anchor))
     {
         emitter.Emit(new AnchorAlias(Anchor));
     }
     else
     {
         Emit(emitter, state);
     }
 }
Example #6
0
 /// <summary>
 /// Saves the current node to the specified emitter.
 /// </summary>
 /// <param name="emitter">The emitter where the node is to be saved.</param>
 /// <param name="state">The state.</param>
 internal abstract void Emit(IEmitter emitter, EmitterState state);
Example #7
0
 /// <summary>
 /// Saves the current node to the specified emitter.
 /// </summary>
 /// <param name="emitter">The emitter where the node is to be saved.</param>
 /// <param name="state">The state.</param>
 internal abstract void Emit(IEmitter emitter, EmitterState state);
Example #8
0
 /// <summary>
 /// Saves the current node to the specified emitter.
 /// </summary>
 /// <param name="emitter">The emitter where the node is to be saved.</param>
 /// <param name="state">The state.</param>
 internal override void Emit(IEmitter emitter, EmitterState state)
 {
     emitter.Emit(new Scalar(Anchor, Tag, Value, Style, true, false));
 }
Example #9
0
		/// <summary>
		/// Saves the current node to the specified emitter.
		/// </summary>
		/// <param name="emitter">The emitter where the node is to be saved.</param>
		/// <param name="state">The state.</param>
		internal override void Emit(IEmitter emitter, EmitterState state)
		{
			throw new NotSupportedException("A YamlAliasNode is an implementation detail and should never be saved.");
		}
Example #10
0
 /// <summary>
 /// Saves the current node to the specified emitter.
 /// </summary>
 /// <param name="emitter">The emitter where the node is to be saved.</param>
 /// <param name="state">The state.</param>
 internal override void Emit(IEmitter emitter, EmitterState state)
 {
     emitter.Emit(new Scalar(Anchor, Tag, Value ?? string.Empty, Style, Tag.IsEmpty, false));
 }
Example #11
0
 /// <summary>
 /// Saves the current node to the specified emitter.
 /// </summary>
 /// <param name="emitter">The emitter where the node is to be saved.</param>
 /// <param name="state">The state.</param>
 internal override void Emit(IEmitter emitter, EmitterState state)
 {
     throw new NotSupportedException("A YamlAliasNode is an implementation detail and should never be saved.");
 }
Example #12
0
 internal override void Emit(IEmitter emitter, EmitterState state)
 {
     emitter.Emit(new Scalar(base.Anchor, base.Tag, Value, Style, base.Tag == null, false));
 }
Example #13
0
 internal override void Emit(IEmitter emitter, EmitterState state)
 {
     emitter.Emit(new Scalar(base.Anchor, base.Tag, this.Value, this.Style, true, false));
 }