Add project files.
This commit is contained in:
40
AssetStudio/YAML/Base/YAMLNode.cs
Normal file
40
AssetStudio/YAML/Base/YAMLNode.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
namespace AssetStudio
|
||||
{
|
||||
public abstract class YAMLNode
|
||||
{
|
||||
internal virtual void Emit(Emitter emitter)
|
||||
{
|
||||
bool isWrote = false;
|
||||
if (!CustomTag.IsEmpty)
|
||||
{
|
||||
emitter.Write(CustomTag.ToString()).WriteWhitespace();
|
||||
isWrote = true;
|
||||
}
|
||||
if (Anchor.Length > 0)
|
||||
{
|
||||
emitter.Write("&").Write(Anchor).WriteWhitespace();
|
||||
isWrote = true;
|
||||
}
|
||||
|
||||
if (isWrote)
|
||||
{
|
||||
if (IsMultiline)
|
||||
{
|
||||
emitter.WriteLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract YAMLNodeType NodeType { get; }
|
||||
public abstract bool IsMultiline { get; }
|
||||
public abstract bool IsIndent { get; }
|
||||
|
||||
public string Tag
|
||||
{
|
||||
get => CustomTag.Content;
|
||||
set => CustomTag = new YAMLTag(YAMLWriter.DefaultTagHandle, value);
|
||||
}
|
||||
public YAMLTag CustomTag { get; set; }
|
||||
public string Anchor { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user