Import YamlDotNet.

This commit is contained in:
2022-12-12 22:23:49 +08:00
parent f559cea826
commit 1477e907e6
462 changed files with 27142 additions and 0 deletions

View File

@@ -0,0 +1,85 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Represents an alias event.
/// </summary>
public sealed class AnchorAlias : ParsingEvent
{
/// <summary>
/// Gets the event type, which allows for simpler type comparisons.
/// </summary>
internal override EventType Type => EventType.Alias;
/// <summary>
/// Gets the value of the alias.
/// </summary>
public AnchorName Value { get; }
/// <summary>
/// Initializes a new instance of the <see cref="AnchorAlias"/> class.
/// </summary>
/// <param name="value">The value of the alias.</param>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public AnchorAlias(AnchorName value, Mark start, Mark end)
: base(start, end)
{
if (value.IsEmpty)
{
throw new YamlException(start, end, "Anchor value must not be empty.");
}
this.Value = value;
}
/// <summary>
/// Initializes a new instance of the <see cref="AnchorAlias"/> class.
/// </summary>
/// <param name="value">The value of the alias.</param>
public AnchorAlias(AnchorName value)
: this(value, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </returns>
public override string ToString()
{
return $"Alias [value = {Value}]";
}
/// <summary>
/// Invokes run-time type specific Visit() method of the specified visitor.
/// </summary>
/// <param name="visitor">visitor, may not be null.</param>
public override void Accept(IParsingEventVisitor visitor)
{
visitor.Visit(this);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 09b29b54793d9644398fe8e4da326353
timeCreated: 1427145262
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,59 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
public sealed class Comment : ParsingEvent
{
public string Value { get; }
public bool IsInline { get; }
public Comment(string value, bool isInline)
: this(value, isInline, Mark.Empty, Mark.Empty)
{
}
public Comment(string value, bool isInline, Mark start, Mark end)
: base(start, end)
{
Value = value;
IsInline = isInline;
}
internal override EventType Type => EventType.Comment;
public override void Accept(IParsingEventVisitor visitor)
{
visitor.Visit(this);
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </returns>
public override string ToString()
{
return $"{(IsInline ? "Inline" : "Block")} Comment [{Value}]";
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e96511072ac5a30488623987ca605570
timeCreated: 1427145267
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,90 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Represents a document end event.
/// </summary>
public sealed class DocumentEnd : ParsingEvent
{
/// <summary>
/// Gets a value indicating the variation of depth caused by this event.
/// The value can be either -1, 0 or 1. For start events, it will be 1,
/// for end events, it will be -1, and for the remaining events, it will be 0.
/// </summary>
public override int NestingIncrease => -1;
/// <summary>
/// Gets the event type, which allows for simpler type comparisons.
/// </summary>
internal override EventType Type => EventType.DocumentEnd;
/// <summary>
/// Gets a value indicating whether this instance is implicit.
/// </summary>
/// <value>
/// <c>true</c> if this instance is implicit; otherwise, <c>false</c>.
/// </value>
public bool IsImplicit { get; }
/// <summary>
/// Initializes a new instance of the <see cref="DocumentEnd"/> class.
/// </summary>
/// <param name="isImplicit">Indicates whether the event is implicit.</param>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public DocumentEnd(bool isImplicit, Mark start, Mark end)
: base(start, end)
{
this.IsImplicit = isImplicit;
}
/// <summary>
/// Initializes a new instance of the <see cref="DocumentEnd"/> class.
/// </summary>
/// <param name="isImplicit">Indicates whether the event is implicit.</param>
public DocumentEnd(bool isImplicit)
: this(isImplicit, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </returns>
public override string ToString()
{
return $"Document end [isImplicit = {IsImplicit}]";
}
/// <summary>
/// Invokes run-time type specific Visit() method of the specified visitor.
/// </summary>
/// <param name="visitor">visitor, may not be null.</param>
public override void Accept(IParsingEventVisitor visitor)
{
visitor.Visit(this);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 99b4ea3b75d2e754cb5fea7cc0f1a4d3
timeCreated: 1427145265
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,128 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using YamlDotNet.Core.Tokens;
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Represents a document start event.
/// </summary>
public sealed class DocumentStart : ParsingEvent
{
/// <summary>
/// Gets a value indicating the variation of depth caused by this event.
/// The value can be either -1, 0 or 1. For start events, it will be 1,
/// for end events, it will be -1, and for the remaining events, it will be 0.
/// </summary>
public override int NestingIncrease => 1;
/// <summary>
/// Gets the event type, which allows for simpler type comparisons.
/// </summary>
internal override EventType Type => EventType.DocumentStart;
/// <summary>
/// Gets the tags.
/// </summary>
/// <value>The tags.</value>
public TagDirectiveCollection? Tags { get; }
/// <summary>
/// Gets the version.
/// </summary>
/// <value>The version.</value>
public VersionDirective? Version { get; }
/// <summary>
/// Gets a value indicating whether this instance is implicit.
/// </summary>
/// <value>
/// <c>true</c> if this instance is implicit; otherwise, <c>false</c>.
/// </value>
public bool IsImplicit { get; }
/// <summary>
/// Initializes a new instance of the <see cref="DocumentStart"/> class.
/// </summary>
/// <param name="version">The version.</param>
/// <param name="tags">The tags.</param>
/// <param name="isImplicit">Indicates whether the event is implicit.</param>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public DocumentStart(VersionDirective? version, TagDirectiveCollection? tags, bool isImplicit, Mark start, Mark end)
: base(start, end)
{
this.Version = version;
this.Tags = tags;
this.IsImplicit = isImplicit;
}
/// <summary>
/// Initializes a new instance of the <see cref="DocumentStart"/> class.
/// </summary>
/// <param name="version">The version.</param>
/// <param name="tags">The tags.</param>
/// <param name="isImplicit">Indicates whether the event is implicit.</param>
public DocumentStart(VersionDirective? version, TagDirectiveCollection? tags, bool isImplicit)
: this(version, tags, isImplicit, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="DocumentStart"/> class.
/// </summary>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public DocumentStart(Mark start, Mark end)
: this(null, null, true, start, end)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="DocumentStart"/> class.
/// </summary>
public DocumentStart()
: this(null, null, true, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </returns>
public override string ToString()
{
return $"Document start [isImplicit = {IsImplicit}]";
}
/// <summary>
/// Invokes run-time type specific Visit() method of the specified visitor.
/// </summary>
/// <param name="visitor">visitor, may not be null.</param>
public override void Accept(IParsingEventVisitor visitor)
{
visitor.Visit(this);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 06cc13f1bc1622246924546d044eede9
timeCreated: 1427145262
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,39 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
internal enum EventType
{
None,
StreamStart,
StreamEnd,
DocumentStart,
DocumentEnd,
Alias,
Scalar,
SequenceStart,
SequenceEnd,
MappingStart,
MappingEnd,
Comment,
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3a7e249b62575e048929c7a3e0420470
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,41 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Callback interface for external event Visitor.
/// </summary>
public interface IParsingEventVisitor
{
void Visit(AnchorAlias e);
void Visit(StreamStart e);
void Visit(StreamEnd e);
void Visit(DocumentStart e);
void Visit(DocumentEnd e);
void Visit(Scalar e);
void Visit(SequenceStart e);
void Visit(SequenceEnd e);
void Visit(MappingStart e);
void Visit(MappingEnd e);
void Visit(Comment e);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 34cdef8e5d4918149bf7185da865504b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,79 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Represents a mapping end event.
/// </summary>
public class MappingEnd : ParsingEvent
{
/// <summary>
/// Gets a value indicating the variation of depth caused by this event.
/// The value can be either -1, 0 or 1. For start events, it will be 1,
/// for end events, it will be -1, and for the remaining events, it will be 0.
/// </summary>
public override int NestingIncrease => -1;
/// <summary>
/// Gets the event type, which allows for simpler type comparisons.
/// </summary>
internal override EventType Type => EventType.MappingEnd;
/// <summary>
/// Initializes a new instance of the <see cref="MappingEnd"/> class.
/// </summary>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public MappingEnd(Mark start, Mark end)
: base(start, end)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="MappingEnd"/> class.
/// </summary>
public MappingEnd()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </returns>
public override string ToString()
{
return "Mapping end";
}
/// <summary>
/// Invokes run-time type specific Visit() method of the specified visitor.
/// </summary>
/// <param name="visitor">visitor, may not be null.</param>
public override void Accept(IParsingEventVisitor visitor)
{
visitor.Visit(this);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 32f12dd96a8cb4d4792ed76749f67b38
timeCreated: 1427145263
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,116 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Represents a mapping start event.
/// </summary>
public sealed class MappingStart : NodeEvent
{
/// <summary>
/// Gets a value indicating the variation of depth caused by this event.
/// The value can be either -1, 0 or 1. For start events, it will be 1,
/// for end events, it will be -1, and for the remaining events, it will be 0.
/// </summary>
public override int NestingIncrease => 1;
/// <summary>
/// Gets the event type, which allows for simpler type comparisons.
/// </summary>
internal override EventType Type => EventType.MappingStart;
/// <summary>
/// Gets a value indicating whether this instance is implicit.
/// </summary>
/// <value>
/// <c>true</c> if this instance is implicit; otherwise, <c>false</c>.
/// </value>
public bool IsImplicit { get; }
/// <summary>
/// Gets a value indicating whether this instance is canonical.
/// </summary>
/// <value></value>
public override bool IsCanonical => !IsImplicit;
/// <summary>
/// Gets the style of the mapping.
/// </summary>
public MappingStyle Style { get; }
/// <summary>
/// Initializes a new instance of the <see cref="MappingStart"/> class.
/// </summary>
/// <param name="anchor">The anchor.</param>
/// <param name="tag">The tag.</param>
/// <param name="isImplicit">Indicates whether the event is implicit.</param>
/// <param name="style">The style of the mapping.</param>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public MappingStart(AnchorName anchor, TagName tag, bool isImplicit, MappingStyle style, Mark start, Mark end)
: base(anchor, tag, start, end)
{
this.IsImplicit = isImplicit;
this.Style = style;
}
/// <summary>
/// Initializes a new instance of the <see cref="MappingStart"/> class.
/// </summary>
/// <param name="anchor">The anchor.</param>
/// <param name="tag">The tag.</param>
/// <param name="isImplicit">Indicates whether the event is implicit.</param>
/// <param name="style">The style of the mapping.</param>
public MappingStart(AnchorName anchor, TagName tag, bool isImplicit, MappingStyle style)
: this(anchor, tag, isImplicit, style, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="MappingStart"/> class.
/// </summary>
public MappingStart()
: this(AnchorName.Empty, TagName.Empty, true, MappingStyle.Any, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </returns>
public override string ToString()
{
return $"Mapping start [anchor = {Anchor}, tag = {Tag}, isImplicit = {IsImplicit}, style = {Style}]";
}
/// <summary>
/// Invokes run-time type specific Visit() method of the specified visitor.
/// </summary>
/// <param name="visitor">visitor, may not be null.</param>
public override void Accept(IParsingEventVisitor visitor)
{
visitor.Visit(this);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 79e25e33bd9642a4ca1c8c5280b30984
timeCreated: 1427145264
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Specifies the style of a mapping.
/// </summary>
public enum MappingStyle
{
/// <summary>
/// Let the emitter choose the style.
/// </summary>
Any,
/// <summary>
/// The block mapping style.
/// </summary>
Block,
/// <summary>
/// The flow mapping style.
/// </summary>
Flow
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7bc885bebca1fac428d7482f06b4f41e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,72 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Contains the behavior that is common between node events.
/// </summary>
public abstract class NodeEvent : ParsingEvent
{
/// <summary>
/// Gets the anchor.
/// </summary>
/// <value></value>
public AnchorName Anchor { get; }
/// <summary>
/// Gets the tag.
/// </summary>
/// <value></value>
public TagName Tag { get; }
/// <summary>
/// Gets a value indicating whether this instance is canonical.
/// </summary>
/// <value></value>
public abstract bool IsCanonical
{
get;
}
/// <summary>
/// Initializes a new instance of the <see cref="NodeEvent"/> class.
/// </summary>
/// <param name="anchor">The anchor.</param>
/// <param name="tag">The tag.</param>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
protected NodeEvent(AnchorName anchor, TagName tag, Mark start, Mark end)
: base(start, end)
{
this.Anchor = anchor;
this.Tag = tag;
}
/// <summary>
/// Initializes a new instance of the <see cref="NodeEvent"/> class.
/// </summary>
protected NodeEvent(AnchorName anchor, TagName tag)
: this(anchor, tag, Mark.Empty, Mark.Empty)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4fa0681239f68a3468223fe925e01d33
timeCreated: 1427145264
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,68 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Base class for parsing events.
/// </summary>
public abstract class ParsingEvent
{
/// <summary>
/// Gets a value indicating the variation of depth caused by this event.
/// The value can be either -1, 0 or 1. For start events, it will be 1,
/// for end events, it will be -1, and for the remaining events, it will be 0.
/// </summary>
public virtual int NestingIncrease => 0;
/// <summary>
/// Gets the event type, which allows for simpler type comparisons.
/// </summary>
internal abstract EventType Type { get; }
/// <summary>
/// Gets the position in the input stream where the event starts.
/// </summary>
public Mark Start { get; }
/// <summary>
/// Gets the position in the input stream where the event ends.
/// </summary>
public Mark End { get; }
/// <summary>
/// Accepts the specified visitor.
/// </summary>
/// <param name="visitor">Visitor to accept, may not be null</param>
public abstract void Accept(IParsingEventVisitor visitor);
/// <summary>
/// Initializes a new instance of the <see cref="ParsingEvent"/> class.
/// </summary>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
internal ParsingEvent(Mark start, Mark end)
{
this.Start = start ?? throw new System.ArgumentNullException(nameof(start));
this.End = end ?? throw new System.ArgumentNullException(nameof(end));
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5dcecbbabc813c74bb16837d87a36f7e
timeCreated: 1427145264
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,143 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Represents a scalar event.
/// </summary>
public sealed class Scalar : NodeEvent
{
/// <summary>
/// Gets the event type, which allows for simpler type comparisons.
/// </summary>
internal override EventType Type => EventType.Scalar;
/// <summary>
/// Gets the value.
/// </summary>
/// <value>The value.</value>
public string Value { get; }
/// <summary>
/// Gets the style of the scalar.
/// </summary>
/// <value>The style.</value>
public ScalarStyle Style { get; }
/// <summary>
/// Gets a value indicating whether the tag is optional for the plain style.
/// </summary>
public bool IsPlainImplicit { get; }
/// <summary>
/// Gets a value indicating whether the tag is optional for any non-plain style.
/// </summary>
public bool IsQuotedImplicit { get; }
/// <summary>
/// Gets a value indicating whether this instance is canonical.
/// </summary>
/// <value></value>
public override bool IsCanonical => !IsPlainImplicit && !IsQuotedImplicit;
/// <summary>
/// Initializes a new instance of the <see cref="Scalar"/> class.
/// </summary>
/// <param name="anchor">The anchor.</param>
/// <param name="tag">The tag.</param>
/// <param name="value">The value.</param>
/// <param name="style">The style.</param>
/// <param name="isPlainImplicit">.</param>
/// <param name="isQuotedImplicit">.</param>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public Scalar(AnchorName anchor, TagName tag, string value, ScalarStyle style, bool isPlainImplicit, bool isQuotedImplicit, Mark start, Mark end)
: base(anchor, tag, start, end)
{
this.Value = value;
this.Style = style;
this.IsPlainImplicit = isPlainImplicit;
this.IsQuotedImplicit = isQuotedImplicit;
}
/// <summary>
/// Initializes a new instance of the <see cref="Scalar"/> class.
/// </summary>
/// <param name="anchor">The anchor.</param>
/// <param name="tag">The tag.</param>
/// <param name="value">The value.</param>
/// <param name="style">The style.</param>
/// <param name="isPlainImplicit">.</param>
/// <param name="isQuotedImplicit">.</param>
public Scalar(AnchorName anchor, TagName tag, string value, ScalarStyle style, bool isPlainImplicit, bool isQuotedImplicit)
: this(anchor, tag, value, style, isPlainImplicit, isQuotedImplicit, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Scalar"/> class.
/// </summary>
/// <param name="value">The value.</param>
public Scalar(string value)
: this(AnchorName.Empty, TagName.Empty, value, ScalarStyle.Any, true, true, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Scalar"/> class.
/// </summary>
/// <param name="tag">The tag.</param>
/// <param name="value">The value.</param>
public Scalar(TagName tag, string value)
: this(AnchorName.Empty, tag, value, ScalarStyle.Any, true, true, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Scalar"/> class.
/// </summary>
public Scalar(AnchorName anchor, TagName tag, string value)
: this(anchor, tag, value, ScalarStyle.Any, true, true, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </returns>
public override string ToString()
{
return $"Scalar [anchor = {Anchor}, tag = {Tag}, value = {Value}, style = {Style}, isPlainImplicit = {IsPlainImplicit}, isQuotedImplicit = {IsQuotedImplicit}]";
}
/// <summary>
/// Invokes run-time type specific Visit() method of the specified visitor.
/// </summary>
/// <param name="visitor">visitor, may not be null.</param>
public override void Accept(IParsingEventVisitor visitor)
{
visitor.Visit(this);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 7c9ef7a4a2cc85b40aea8fda0d00cb33
timeCreated: 1427145265
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,79 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Represents a sequence end event.
/// </summary>
public sealed class SequenceEnd : ParsingEvent
{
/// <summary>
/// Gets a value indicating the variation of depth caused by this event.
/// The value can be either -1, 0 or 1. For start events, it will be 1,
/// for end events, it will be -1, and for the remaining events, it will be 0.
/// </summary>
public override int NestingIncrease => -1;
/// <summary>
/// Gets the event type, which allows for simpler type comparisons.
/// </summary>
internal override EventType Type => EventType.SequenceEnd;
/// <summary>
/// Initializes a new instance of the <see cref="SequenceEnd"/> class.
/// </summary>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public SequenceEnd(Mark start, Mark end)
: base(start, end)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="SequenceEnd"/> class.
/// </summary>
public SequenceEnd()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </returns>
public override string ToString()
{
return "Sequence end";
}
/// <summary>
/// Invokes run-time type specific Visit() method of the specified visitor.
/// </summary>
/// <param name="visitor">visitor, may not be null.</param>
public override void Accept(IParsingEventVisitor visitor)
{
visitor.Visit(this);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 37a7a63228a311b46ae903ea604105df
timeCreated: 1427145263
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,105 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Represents a sequence start event.
/// </summary>
public sealed class SequenceStart : NodeEvent
{
/// <summary>
/// Gets a value indicating the variation of depth caused by this event.
/// The value can be either -1, 0 or 1. For start events, it will be 1,
/// for end events, it will be -1, and for the remaining events, it will be 0.
/// </summary>
public override int NestingIncrease => 1;
/// <summary>
/// Gets the event type, which allows for simpler type comparisons.
/// </summary>
internal override EventType Type => EventType.SequenceStart;
/// <summary>
/// Gets a value indicating whether this instance is implicit.
/// </summary>
/// <value>
/// <c>true</c> if this instance is implicit; otherwise, <c>false</c>.
/// </value>
public bool IsImplicit { get; }
/// <summary>
/// Gets a value indicating whether this instance is canonical.
/// </summary>
/// <value></value>
public override bool IsCanonical => !IsImplicit;
/// <summary>
/// Gets the style.
/// </summary>
/// <value>The style.</value>
public SequenceStyle Style { get; }
/// <summary>
/// Initializes a new instance of the <see cref="SequenceStart"/> class.
/// </summary>
/// <param name="anchor">The anchor.</param>
/// <param name="tag">The tag.</param>
/// <param name="isImplicit">if set to <c>true</c> [is implicit].</param>
/// <param name="style">The style.</param>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public SequenceStart(AnchorName anchor, TagName tag, bool isImplicit, SequenceStyle style, Mark start, Mark end)
: base(anchor, tag, start, end)
{
this.IsImplicit = isImplicit;
this.Style = style;
}
/// <summary>
/// Initializes a new instance of the <see cref="SequenceStart"/> class.
/// </summary>
public SequenceStart(AnchorName anchor, TagName tag, bool isImplicit, SequenceStyle style)
: this(anchor, tag, isImplicit, style, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </returns>
public override string ToString()
{
return $"Sequence start [anchor = {Anchor}, tag = {Tag}, isImplicit = {IsImplicit}, style = {Style}]";
}
/// <summary>
/// Invokes run-time type specific Visit() method of the specified visitor.
/// </summary>
/// <param name="visitor">visitor, may not be null.</param>
public override void Accept(IParsingEventVisitor visitor)
{
visitor.Visit(this);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d0414698332e0c643ad3fddd1b907b5e
timeCreated: 1427145266
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Specifies the style of a sequence.
/// </summary>
public enum SequenceStyle
{
/// <summary>
/// Let the emitter choose the style.
/// </summary>
Any,
/// <summary>
/// The block sequence style.
/// </summary>
Block,
/// <summary>
/// The flow sequence style.
/// </summary>
Flow
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f66466d1eedabbe4db084d2d0e64415b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,91 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Represents a stream end event.
/// </summary>
public sealed class StreamEnd : ParsingEvent
{
/// <summary>
/// Gets a value indicating the variation of depth caused by this event.
/// The value can be either -1, 0 or 1. For start events, it will be 1,
/// for end events, it will be -1, and for the remaining events, it will be 0.
/// </summary>
public override int NestingIncrease
{
get
{
return -1;
}
}
/// <summary>
/// Gets the event type, which allows for simpler type comparisons.
/// </summary>
internal override EventType Type
{
get
{
return EventType.StreamEnd;
}
}
/// <summary>
/// Initializes a new instance of the <see cref="StreamEnd"/> class.
/// </summary>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public StreamEnd(Mark start, Mark end)
: base(start, end)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="StreamEnd"/> class.
/// </summary>
public StreamEnd()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </returns>
public override string ToString()
{
return "Stream end";
}
/// <summary>
/// Invokes run-time type specific Visit() method of the specified visitor.
/// </summary>
/// <param name="visitor">visitor, may not be null.</param>
public override void Accept(IParsingEventVisitor visitor)
{
visitor.Visit(this);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 703673d959fca474691646e24e9ccedb
timeCreated: 1427145264
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,91 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Events
{
/// <summary>
/// Represents a stream start event.
/// </summary>
public sealed class StreamStart : ParsingEvent
{
/// <summary>
/// Gets a value indicating the variation of depth caused by this event.
/// The value can be either -1, 0 or 1. For start events, it will be 1,
/// for end events, it will be -1, and for the remaining events, it will be 0.
/// </summary>
public override int NestingIncrease
{
get
{
return 1;
}
}
/// <summary>
/// Gets the event type, which allows for simpler type comparisons.
/// </summary>
internal override EventType Type
{
get
{
return EventType.StreamStart;
}
}
/// <summary>
/// Initializes a new instance of the <see cref="StreamStart"/> class.
/// </summary>
public StreamStart()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="StreamStart"/> class.
/// </summary>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public StreamStart(Mark start, Mark end)
: base(start, end)
{
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </returns>
public override string ToString()
{
return "Stream start";
}
/// <summary>
/// Invokes run-time type specific Visit() method of the specified visitor.
/// </summary>
/// <param name="visitor">visitor, may not be null.</param>
public override void Accept(IParsingEventVisitor visitor)
{
visitor.Visit(this);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8127a5c9cbbe94547a9c1d39fee327db
timeCreated: 1427145265
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: