public override string ToYamlString(YNodeStyle style) { return(style == YNodeStyle.Block ? string.Join("\n", this.Select(i => i.ToYamlString(style))) : this.Any() ? $"{{ {string.Join(", ", this.Select(i => i.ToYamlString(style)))} }}" : "{}"); }
public override string ToYamlString(YNodeStyle style) { return(style == YNodeStyle.Block ? this.Key.ToYamlString(YNodeStyle.Flow) + ": " + (this.Value.Style == YNodeStyle.Block && this.Value is YCollection <YKeyValuePair> ? "\n" + AddIndent(this.Value.ToYamlString()) : AddIndent(this.Value.ToYamlString()).Substring(2)) : this.Key.ToYamlString(YNodeStyle.Flow) + ": " + this.Value.ToYamlString(YNodeStyle.Flow)); }
public override string ToYamlString(YNodeStyle style) { return(style == YNodeStyle.Block ? $"|-\n{AddIndent(this.Value)}" : this.Value.IndexOfAny(new[] { '-', '{', '}', '[', ']', '|', '>', '?' }) == 0 || this.Value.IndexOfAny(new[] { '\a', '\b', '\t', '\0', '\r', ':' }) != -1 ? $"\"{EscapeString(this.Value)}\"" : this.Value); }
public override string ToYamlString(YNodeStyle style) { return(style == YNodeStyle.Block ? string.Join("\n", this.Select(i => { var rt = i.ToYamlString(); if (i.Style == YNodeStyle.Block && i is YSequence) { rt = "\n" + AddIndent(rt); } else { rt = AddIndent(rt).Substring(2); } return "- " + rt; })) : this.Any() ? $"[ {string.Join(", ", this.Select(i => i.ToYamlString(style)))} ]" : "[]"); }
public YCollection(YNodeStyle style, params YNode[] content) : base(style) { this.Initialize(content); }
public override string ToString(YNodeStyle style) { return(style == YNodeStyle.Block ? $"? {this.Key}\n: {this.Value}" : $"? {this.Key.ToString(style)} : {this.Value.ToString(style)}"); }
public YMapping(int indentLevel, YNodeStyle style = YNodeStyle.Block, params YNode[] content) : base(style, content) { this.IndentLevel = indentLevel; }
public override string ToString(YNodeStyle style) { return(this.Name); }
public override string ToString(YNodeStyle style) { return(style == YNodeStyle.Block ? $"str: |-\n{AddIndent(this.Value)}" : $"str: \"{EscapeString(this.Value)}\""); }
private YSequence(YNodeStyle style, params YNode[] content) : base(style, content) { }
public override string ToYamlString(YNodeStyle style) { return(this.Value.ToYamlString(style)); }
protected YNode(YNodeStyle style) { this.Style = style; }
public abstract string ToYamlString(YNodeStyle style);
public override string ToYamlString(YNodeStyle style) { return("---\n" + string.Join("\n", this.Select(i => i.ToYamlString()))); }
public YDocument(YNodeStyle style, params YNode[] content) : base(style, content) { }
public YScalar(YNodeStyle style = YNodeStyle.Flow) : base(style) { }
public YScalar(string value, YNodeStyle style = YNodeStyle.Flow) : this(style) { this.Value = value; }
internal YSequence(YNodeStyle style, params YNode[] content) : base(style, content) { }
public override string ToString(YNodeStyle style) { return(style == YNodeStyle.Block ? $"!!map {{\n{string.Join("\n", this.Select(i => AddIndent(i.ToString() + ",")))}\n}}" : $"!!map {{ {string.Join(" ", this.Select(i => i.ToString(style) + ","))} }}"); }
public YMapping(YNodeStyle style = YNodeStyle.Block, params YNode[] content) : base(style, content) { }