diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 759c459..d262654 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2019, windows-2022] + os: [windows-latest] steps: - uses: actions/checkout@v3 @@ -40,7 +40,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, ubuntu-24.04, macos-latest, windows-2019, windows-2022] + os: [macos-latest, ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 diff --git a/Tests/powershell-yaml.Tests.ps1 b/Tests/powershell-yaml.Tests.ps1 index 1dc1d74..d87a284 100644 --- a/Tests/powershell-yaml.Tests.ps1 +++ b/Tests/powershell-yaml.Tests.ps1 @@ -1065,9 +1065,9 @@ reallyLongDecimal: 3.9999999999999990 Describe 'StringQuotingEmitter' { BeforeAll { - $oldYamlPkgUrl = 'https://www.nuget.org/api/v2/package/YamlDotNet/11.2.1' - $pkgPath = Join-Path -Path $TestDrive -ChildPath 'YamlDotNet-11.2.1.nupkg' - $oldYamlPkgDirPath = Join-Path -Path $TestDrive -ChildPath 'YamlDotNet-11.2.1' + $oldYamlPkgUrl = 'https://www.nuget.org/api/v2/package/YamlDotNet/16.3.0' + $pkgPath = Join-Path -Path $TestDrive -ChildPath 'YamlDotNet-16.3.0.nupkg' + $oldYamlPkgDirPath = Join-Path -Path $TestDrive -ChildPath 'YamlDotNet-16.3.0' $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri $oldYamlPkgUrl -UseBasicParsing -OutFile $pkgPath New-Item -Path $oldYamlPkgDirPath -ItemType Directory @@ -1075,21 +1075,17 @@ reallyLongDecimal: 3.9999999999999990 [IO.Compression.ZipFile]::ExtractToDirectory($pkgPath, $oldYamlPkgDirPath) } - $targetFrameworks = @('net45', 'netstandard1.3') - if ($PSVersionTable['PSEdition'] -eq 'Core') - { - $targetFrameworks = @('netstandard1.3', 'netstandard2.1') - } + $targetFrameworks = @('netstandard2.0') It 'can be compiled on import with <_>/YamlDotNet.dll loaded' -ForEach $targetFrameworks { $targetFramework = $_ $yamlDotnetAssemblyPath = - Join-Path -Path $TestDrive -ChildPath "YamlDotNet-11.2.1\lib\${targetFramework}\YamlDotNet.dll" -Resolve + Join-Path -Path $TestDrive -ChildPath "YamlDotNet-16.3.0\lib\${targetFramework}\YamlDotNet.dll" -Resolve $modulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\powershell-yaml.psd1' -Resolve { # Do this in the background because YamlDotNet.dll is already loaded in this session and the way we - # found to reproduce this issue is by loading YamlDotNet 11.2.1 then importing powershell-yaml. + # found to reproduce this issue is by loading YamlDotNet 16.3.0 then importing powershell-yaml. Start-Job { $yamlDotnetAssemblyPath = $using:yamlDotnetAssemblyPath $modulePath = $using:modulePath diff --git a/build.ps1 b/build.ps1 index b5e850c..6e14449 100644 --- a/build.ps1 +++ b/build.ps1 @@ -17,7 +17,7 @@ $here = Split-Path -Parent $MyInvocation.MyCommand.Path dotnet build --configuration Release $here/src/ -$destinations = @("netstandard2.1", "net47") +$destinations = @("netstandard2.0") foreach ($item in $destinations) { $src = Join-Path $here "src" "bin" "Release" $item "PowerShellYamlSerializer.dll" diff --git a/lib/net47/PowerShellYamlSerializer.dll b/lib/net47/PowerShellYamlSerializer.dll deleted file mode 100644 index 904b86b..0000000 Binary files a/lib/net47/PowerShellYamlSerializer.dll and /dev/null differ diff --git a/lib/net47/YamlDotNet.dll b/lib/net47/YamlDotNet.dll deleted file mode 100644 index 25a1106..0000000 Binary files a/lib/net47/YamlDotNet.dll and /dev/null differ diff --git a/lib/net47/YamlDotNet.xml b/lib/net47/YamlDotNet.xml deleted file mode 100644 index aa0e99e..0000000 --- a/lib/net47/YamlDotNet.xml +++ /dev/null @@ -1,6039 +0,0 @@ - - - - YamlDotNet - - - - - The exception that is thrown when an alias references an anchor that does not exist. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Defines constants that relate to the YAML specification. - - - - - Emits YAML streams. - - - - - Initializes a new instance of the class. - - The where the emitter will write. - - - - Initializes a new instance of the class. - - The where the emitter will write. - The preferred indentation. - - - - Initializes a new instance of the class. - - The where the emitter will write. - The preferred indentation. - The preferred text width. - - - - Initializes a new instance of the class. - - The where the emitter will write. - The preferred indentation. - The preferred text width. - If true, write the output in canonical form. - - - - Emit an evt. - - - - - Check if we need to accumulate more events before emitting. - - We accumulate extra - - 1 event for DOCUMENT-START - - 2 events for SEQUENCE-START - - 3 events for MAPPING-START - - - - - Expect STREAM-START. - - - - - Expect DOCUMENT-START or STREAM-END. - - - - - Expect the root node. - - - - - Expect a node. - - - - - Expect ALIAS. - - - - - Expect SCALAR. - - - - - Expect SEQUENCE-START. - - - - - Expect MAPPING-START. - - - - - Expect DOCUMENT-END. - - - - - Expect a flow item node. - - - - - Expect a flow key node. - - - - - Expect a flow value node. - - - - - Expect a block item node. - - - - - Expect a block key node. - - - - - Expect a block value node. - - - - - Check if the document content is an empty scalar. - - - - - Check if the next node can be expressed as a simple key. - - - - - The preferred indentation. - - - - - The preferred text width. - - - - - New line characters. - - - - - If true, write the output in canonical form. - - - - - If true, write output without anchor names. - - - - - The maximum allowed length for simple keys. - - - The specifiction mandates 1024 characters, but any desired value may be used. - - - - - Indent sequences. The default is to not indent. - - - - - Represents an alias event. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets the value of the alias. - - - - - Initializes a new instance of the class. - - The value of the alias. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - The value of the alias. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Represents a document end event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets a value indicating whether this instance is implicit. - - - true if this instance is implicit; otherwise, false. - - - - - Initializes a new instance of the class. - - Indicates whether the event is implicit. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - Indicates whether the event is implicit. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Represents a document start event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets the tags. - - The tags. - - - - Gets the version. - - The version. - - - - Gets a value indicating whether this instance is implicit. - - - true if this instance is implicit; otherwise, false. - - - - - Initializes a new instance of the class. - - The version. - The tags. - Indicates whether the event is implicit. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - The version. - The tags. - Indicates whether the event is implicit. - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Callback interface for external event Visitor. - - - - - Represents a mapping end event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Represents a mapping start event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets a value indicating whether this instance is implicit. - - - true if this instance is implicit; otherwise, false. - - - - - Gets a value indicating whether this instance is canonical. - - - - - - Gets the style of the mapping. - - - - - Initializes a new instance of the class. - - The anchor. - The tag. - Indicates whether the event is implicit. - The style of the mapping. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - The anchor. - The tag. - Indicates whether the event is implicit. - The style of the mapping. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Specifies the style of a mapping. - - - - - Let the emitter choose the style. - - - - - The block mapping style. - - - - - The flow mapping style. - - - - - Contains the behavior that is common between node events. - - - - - Gets the anchor. - - - - - - Gets the tag. - - - - - - Gets a value indicating whether this instance is canonical. - - - - - - Initializes a new instance of the class. - - The anchor. - The tag. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Base class for parsing events. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets the position in the input stream where the event starts. - - - - - Gets the position in the input stream where the event ends. - - - - - Accepts the specified visitor. - - Visitor to accept, may not be null - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Represents a scalar event. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets the value. - - The value. - - - - Gets the style of the scalar. - - The style. - - - - Gets a value indicating whether the tag is optional for the plain style. - - - - - Gets a value indicating whether the tag is optional for any non-plain style. - - - - - Gets a value indicating whether this instance is canonical. - - - - - - Gets whether this scalar event is a key - - - - - Initializes a new instance of the class. - - The anchor. - The tag. - The value. - The style. - . - . - The start position of the event. - The end position of the event. - Whether or not this scalar event is for a key - - - - Initializes a new instance of the class. - - The anchor. - The tag. - The value. - The style. - . - . - - - - Initializes a new instance of the class. - - The value. - - - - Initializes a new instance of the class. - - The tag. - The value. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Represents a sequence end event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Represents a sequence start event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets a value indicating whether this instance is implicit. - - - true if this instance is implicit; otherwise, false. - - - - - Gets a value indicating whether this instance is canonical. - - - - - - Gets the style. - - The style. - - - - Initializes a new instance of the class. - - The anchor. - The tag. - if set to true [is implicit]. - The style. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Specifies the style of a sequence. - - - - - Let the emitter choose the style. - - - - - The block sequence style. - - - - - The flow sequence style. - - - - - Represents a stream end event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Represents a stream start event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - The exception that is thrown when an alias references an anchor - that has not yet been defined in a context that does not support forward references. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Supports implementations of by providing methods to combine two hash codes. - - - - - Combines two hash codes. - - The first hash code. - The second hash code. - - - - - Represents a YAML stream emitter. - - - - - Emits an event. - - - - - Gets a value indicating whether the end of the input reader has been reached. - - - - - Gets the character at the specified offset. - - - - - Skips the next characters. Those characters must have been - obtained first by calling the method. - - - - - Generic queue on which items may be inserted - - - - - Gets the number of items that are contained by the queue. - - - - - Enqueues the specified item. - - The item to be enqueued. - - - - Dequeues an item. - - Returns the item that been dequeued. - - - - Inserts an item at the specified index. - - The index where to insert the item. - The item to be inserted. - - - - Represents a YAML stream parser. - - - - - Gets the current event. Returns null before the first call to , - and also after returns false. - - - - - Moves to the next event. - - Returns true if there are more events available, otherwise returns false. - - - - Defines the interface for a stand-alone YAML scanner that - converts a sequence of characters into a sequence of YAML tokens. - - - - - Gets the current position inside the input stream. - - The current position. - - - - Gets the current token. - - - - - Moves to the next token and consumes the current token. - - - - - Moves to the next token without consuming the current token. - - - - - Consumes the current token. - - - - - Provides access to a stream and allows to peek at the next characters, - up to the buffer's capacity. - - - This class implements a circular buffer with a fixed capacity. - - - - - Initializes a new instance of the class. - - The input. - The capacity. - - - - Gets a value indicating whether the end of the input reader has been reached. - - - - - Gets the index of the character for the specified offset. - - - - - Gets the character at the specified offset. - - - - - Reads characters until at least characters are in the buffer. - - - Number of characters to cache. - - - - - Skips the next characters. Those characters must have been - obtained first by calling the or methods. - - - - - Represents a location inside a file - - - - - Gets a with empty values. - - - - - Gets / sets the absolute offset in the file - - - - - Gets / sets the number of the line - - - - - Gets / sets the index of the column - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - - - - - - - - - - - - - - - - Exception that is thrown when an infinite recursion is detected. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Simple implementation of that implements merging: http://yaml.org/type/merge.html - - - - - Parses YAML streams. - - - - - Initializes a new instance of the class. - - The input where the YAML stream is to be read. - - - - Initializes a new instance of the class. - - - - - Gets the current event. - - - - - Moves to the next event. - - Returns true if there are more events available, otherwise returns false. - - - - Parse the production: - stream ::= STREAM-START implicit_document? explicit_document* STREAM-END - ************ - - - - - Parse the productions: - implicit_document ::= block_node DOCUMENT-END* - * - explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* - ************************* - - - - - Parse directives. - - - - - Parse the productions: - explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* - *********** - - - - - Generate an empty scalar event. - - - - - Parse the productions: - block_node_or_indentless_sequence ::= - ALIAS - ***** - | properties (block_content | indentless_block_sequence)? - ********** * - | block_content | indentless_block_sequence - * - block_node ::= ALIAS - ***** - | properties block_content? - ********** * - | block_content - * - flow_node ::= ALIAS - ***** - | properties flow_content? - ********** * - | flow_content - * - properties ::= TAG ANCHOR? | ANCHOR TAG? - ************************* - block_content ::= block_collection | flow_collection | SCALAR - ****** - flow_content ::= flow_collection | SCALAR - ****** - - - - - Parse the productions: - implicit_document ::= block_node DOCUMENT-END* - ************* - explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* - ************* - - - - - Parse the productions: - block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END - ******************** *********** * ********* - - - - - Parse the productions: - indentless_sequence ::= (BLOCK-ENTRY block_node?)+ - *********** * - - - - - Parse the productions: - block_mapping ::= BLOCK-MAPPING_START - ******************* - ((KEY block_node_or_indentless_sequence?)? - *** * - (VALUE block_node_or_indentless_sequence?)?)* - - BLOCK-END - ********* - - - - - Parse the productions: - block_mapping ::= BLOCK-MAPPING_START - - ((KEY block_node_or_indentless_sequence?)? - - (VALUE block_node_or_indentless_sequence?)?)* - ***** * - BLOCK-END - - - - - - Parse the productions: - flow_sequence ::= FLOW-SEQUENCE-START - ******************* - (flow_sequence_entry FLOW-ENTRY)* - * ********** - flow_sequence_entry? - * - FLOW-SEQUENCE-END - ***************** - flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * - - - - - Parse the productions: - flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - *** * - - - - - Parse the productions: - flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - ***** * - - - - - Parse the productions: - flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * - - - - - Parse the productions: - flow_mapping ::= FLOW-MAPPING-START - ****************** - (flow_mapping_entry FLOW-ENTRY)* - * ********** - flow_mapping_entry? - ****************** - FLOW-MAPPING-END - **************** - flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * *** * - - - - - Parse the productions: - flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * ***** * - - - - - Extension methods that provide useful abstractions over . - - - - - Ensures that the current event is of the specified type, returns it and moves to the next event. - - Type of the . - Returns the current event. - If the current event is not of the specified type. - - - - Checks whether the current event is of the specified type. - If the event is of the specified type, returns it and moves to the next event. - Otherwise returns null. - - Type of the . - Returns true if the current event is of type T; otherwise returns null. - - - - Enforces that the current event is of the specified type. - - Type of the . - Returns the current event. - If the current event is not of the specified type. - - - - Checks whether the current event is of the specified type. - - Type of the event. - Returns true if the current event is of type . Otherwise returns false. - - - - Skips the current event and any nested event. - - - - - Attempts to find a key on a YAML mapping that matches our predicate. - This is useful for scanning a mapping for type discriminator information. - For example: looking for a `kind` key on an object. - - This function only checks mappings, and only looks at the current depth. - - If the event is a mapping and has a key that satisfies the predicate the scan - will stop, return true, and set and - . All events up until the predicate is matched will - be consumed. - - If the event is not a mapping event or a matching key is not found, returns false. - - The IParser which will have its current value checked for a matching mapping entry - The selector to filter the mapping by - The matching key of the mapping as a Scalar, or null if no matching key found - The matching value of the mapping as a ParsingEvent, or null if no matching key found - Returns true if the current event is a mapping entry with a key that matches the selector; - otherwise returns false. - - - - Keeps track of the recursion level, - and throws - whenever is reached. - - - - - Increments the recursion level, - and throws - if is reached. - - - - - Increments the recursion level, - and returns whether is still less than . - - - - - Decrements the recursion level. - - - - - Specifies the style of a YAML scalar. - - - - - Let the emitter choose the style. - - - - - The plain scalar style. - - - - - The single-quoted scalar style. - - - - - The double-quoted scalar style. - - - - - The literal scalar style. - - - - - The folded scalar style. - - - - - Converts a sequence of characters into a sequence of YAML tokens. - - - - - Gets the current token. - - - - - Initializes a new instance of the class. - - The input. - Indicates whether comments should be ignored - - - - Gets the current position inside the input stream. - - The current position. - - - - Moves to the next token. - - - - - - Consumes the current token and increments the parsed token count - - - - - Check the list of potential simple keys and remove the positions that - cannot contain simple keys anymore. - - - - - Pop indentation levels from the indents stack until the current level - becomes less or equal to the column. For each indentation level, append - the BLOCK-END token. - - - - - Produce the STREAM-END token and shut down the scanner. - - - - - Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token. - - Scope: - %YAML 1.1 # a comment \n - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - %TAG !yaml! tag:yaml.org,2002: \n - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - - - - Produce the DOCUMENT-START or DOCUMENT-END token. - - - - - Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token. - - - - - Increase the flow level and resize the simple key list if needed. - - - - - Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token. - - - - - Decrease the flow level. - - - - - Produce the FLOW-ENTRY token. - - - - - Produce the BLOCK-ENTRY token. - - - - - Produce the KEY token. - - - - - Produce the VALUE token. - - - - - Push the current indentation level to the stack and set the new level - the current column is greater than the indentation level. In this case, - append or insert the specified token into the token queue. - - - - - Produce the ALIAS or ANCHOR token. - - - - - Produce the TAG token. - - - - - Scan a TAG token. - - - - - Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens. - - - - - Scan a block scalar. - - - - - Scan indentation spaces and line breaks for a block scalar. Determine the - indentation level if needed. - - - - - Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens. - - - - - Scan a quoted scalar. - - - - - Produce the SCALAR(...,plain) token. - - - - - Scan a plain scalar. - - - - - Remove a potential simple key at the current flow level. - - - - - Scan the directive name. - - Scope: - %YAML 1.1 # a comment \n - ^^^^ - %TAG !yaml! tag:yaml.org,2002: \n - ^^^ - - - - - Scan the value of VERSION-DIRECTIVE. - - Scope: - %YAML 1.1 # a comment \n - ^^^^^^ - - - - - Scan the value of a TAG-DIRECTIVE token. - - Scope: - %TAG !yaml! tag:yaml.org,2002: \n - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - - - - Scan a tag. - - - - - Decode an URI-escape sequence corresponding to a single UTF-8 character. - - - - - Scan a tag handle. - - - - - Scan the version number of VERSION-DIRECTIVE. - - Scope: - %YAML 1.1 # a comment \n - ^ - %YAML 1.1 # a comment \n - ^ - - - - - Check if a simple key may start at the current position and add it if - needed. - - - - - Exception that is thrown when a semantic error is detected on a YAML stream. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Exception that is thrown when a syntax error is detected on a YAML stream. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Collection of . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - Initial content of the collection. - - - - - - - Gets a value indicating whether the collection contains a directive with the same handle - - - - - Represents an anchor token. - - - - - Gets the value. - - The value. - - - - Initializes a new instance of the class. - - The value. - - - - Initializes a new instance of the class. - - The value. - The start position of the token. - The end position of the token. - - - - Represents an alias token. - - - - - Gets the value of the alias. - - - - - Initializes a new instance of the class. - - The value of the anchor. - - - - Initializes a new instance of the class. - - The value of the anchor. - The start position of the event. - The end position of the event. - - - - Represents a block end token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a block entry event. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a block mapping start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a block sequence start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a comment - - - - - Gets the value of the comment - - - - - Gets a value indicating whether the comment appears other tokens on that line. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Represents a document end token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a document start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Error tokens. - - - - - Gets the value of the error - - - - - Represents a flow entry event. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a flow mapping end token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a flow mapping start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a flow sequence end token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a flow sequence start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a key token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a scalar token. - - - - - Gets or sets whether this scalar is a key - - - - - Gets the value. - - The value. - - - - Gets the style. - - The style. - - - - Initializes a new instance of the class. - - The value. - - - - Initializes a new instance of the class. - - The value. - The style. - - - - Initializes a new instance of the class. - - The value. - The style. - The start position of the token. - The end position of the token. - - - - Represents a stream end event. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a stream start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a tag token. - - - - - Gets the handle. - - The handle. - - - - Gets the suffix. - - The suffix. - - - - Initializes a new instance of the class. - - The handle. - The suffix. - - - - Initializes a new instance of the class. - - The handle. - The suffix. - The start position of the token. - The end position of the token. - - - - Represents a tag directive token. - - - - - Gets the handle. - - The handle. - - - - Gets the prefix. - - The prefix. - - - - Initializes a new instance of the class. - - The handle. - The prefix. - - - - Initializes a new instance of the class. - - The handle. - The prefix. - The start position of the token. - The end position of the token. - - - - Determines whether the specified System.Object is equal to the current System.Object. - - The System.Object to compare with the current System.Object. - - true if the specified System.Object is equal to the current System.Object; otherwise, false. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - - - - Base class for YAML tokens. - - - - - Gets the start of the token in the input stream. - - - - - Gets the end of the token in the input stream. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a value token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a version directive token. - - - - - Gets the version. - - The version. - - - - Initializes a new instance of the class. - - The version. - - - - Initializes a new instance of the class. - - The version. - The start position of the token. - The end position of the token. - - - - Determines whether the specified System.Object is equal to the current System.Object. - - The System.Object to compare with the current System.Object. - - true if the specified System.Object is equal to the current System.Object; otherwise, false. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Specifies the version of the YAML language. - - - - - Gets the major version number. - - - - - Gets the minor version number. - - - - - Initializes a new instance of the class. - - The major version number. - The minor version number. - - - - Determines whether the specified System.Object is equal to the current System.Object. - - The System.Object to compare with the current System.Object. - - true if the specified System.Object is equal to the current System.Object; otherwise, false. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Base exception that is thrown when the a problem occurs in the YamlDotNet library. - - - - - Gets the position in the input stream where the event that originated the exception starts. - - - - - Gets the position in the input stream where the event that originated the exception ends. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Generic implementation of object pooling pattern with predefined pool size limit. The main - purpose is that limited number of frequently used objects can be kept in the pool for - further recycling. - - Notes: - 1) it is not the goal to keep all returned objects. Pool is not meant for storage. If there - is no space in the pool, extra returned objects will be dropped. - - 2) it is implied that if object was obtained from a pool, the caller will return it back in - a relatively short time. Keeping checked out objects for long durations is ok, but - reduces usefulness of pooling. Just new up your own. - - Not returning objects to the pool in not detrimental to the pool's work, but is a bad practice. - Rationale: - If there is no intent for reusing the object, do not use pool - just use "new". - - - - - Not using System.Func{T} because this file is linked into the (debugger) Formatter, - which does not have that type (since it compiles against .NET 2.0). - - - - - Produces an instance. - - - Search strategy is a simple linear probing which is chosen for it cache-friendliness. - Note that Free will try to store recycled objects close to the start thus statistically - reducing how far we will typically search. - - - - - Returns objects to the pool. - - - Search strategy is a simple linear probing which is chosen for it cache-friendliness. - Note that Free will try to store recycled objects close to the start thus statistically - reducing how far we will typically search in Allocate. - - - - - Returns the that describes the property that - is being returned in an expression in the form: - - x => x.SomeProperty - - - - - - Adapts an to - because not all generic collections implement . - - - - - Adapts an to - because not all generic dictionaries implement . - - - - - Gets or sets the element with the specified index. - - The index of the element to get or set. - The element with the specified index. - - - - Adds an element with the provided key and value to the - at the given index. - - The zero-based index at which the item should be inserted. - The object to use as the key of the element to add. - The object to use as the value of the element to add. - - - - Removes the element at the specified index. - - The zero-based index of the element to remove. - - - - Pooling of StringBuilder instances. - - - - - Determines whether the specified type has a default constructor. - - The type. - Whether to include private constructors - - true if the type has a default constructor; otherwise, false. - - - - - Manages the state of a while it is loading. - - - - - Adds the specified node to the anchor list. - - The node. - - - - Gets the node with the specified anchor. - - The anchor. - The start position. - The end position. - - if there is no node with that anchor. - - - - Gets the node with the specified anchor. - - The anchor. - The node that was retrieved. - true if the anchor was found; otherwise false. - - - - Adds the specified node to the collection of nodes with unresolved aliases. - - - The that has unresolved aliases. - - - - - Resolves the aliases that could not be resolved while loading the document. - - - - - Holds state that is used when emitting a stream. - - - - - Gets the already emitted anchors. - - The emitted anchors. - - - - Defines the method needed to be able to visit Yaml elements. - - - - - Visits a . - - - The that is being visited. - - - - - Visits a . - - - The that is being visited. - - - - - Visits a . - - - The that is being visited. - - - - - Visits a . - - - The that is being visited. - - - - - Visits a . - - - The that is being visited. - - - - - Represents a LibYAML event stream. - - - - - Initializes a new instance of the class - from the specified . - - - - - Represents an alias node in the YAML document. - - - - - Initializes a new instance of the class. - - The anchor. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Recursively enumerates all the nodes from the document, starting on the current node, - and throwing - if is reached. - - - - - Gets the type of node. - - - - - Represents an YAML document. - - - - - Gets or sets the root node. - - The root node. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with a single scalar node. - - - - - Initializes a new instance of the class. - - - - - Visitor that assigns anchors to nodes that are referenced more than once. - Existing anchors are preserved as much as possible. - - - - - Key: Node, Value: IsDuplicate - - - - - Returns whether the visited node is a duplicate. - - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - Gets all nodes from the document. - is thrown if an infinite recursion is detected. - - - - - Represents a mapping node in the YAML document. - - - - - Gets the children of the current node. - - The children. - - - - Gets or sets the style of the node. - - The style. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - A sequence of where even elements are keys and odd elements are values. - - - - Initializes a new instance of the class. - - A sequence of where even elements are keys and odd elements are values. - - - - Adds the specified mapping to the collection. - - The key node. - The value node. - - - - Adds the specified mapping to the collection. - - The key node. - The value node. - - - - Adds the specified mapping to the collection. - - The key node. - The value node. - - - - Adds the specified mapping to the collection. - - The key node. - The value node. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Recursively enumerates all the nodes from the document, starting on the current node, - and throwing - if is reached. - - - - - Gets the type of node. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - - - - Creates a containing a key-value pair for each property of the specified object. - - - - - Represents a single node in the YAML document. - - - - - Gets or sets the anchor of the node. - - The anchor. - - - - Gets or sets the tag of the node. - - The tag. - - - - Gets the position in the input stream where the event that originated the node starts. - - - - - Gets the position in the input stream where the event that originated the node ends. - - - - - Loads the specified event. - - The event. - The state of the document. - - - - Parses the node represented by the next event in . - - Returns the node that has been parsed. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - Gets all nodes from the document, starting on the current node. - is thrown if an infinite recursion is detected. - - - - - When implemented, recursively enumerates all the nodes from the document, starting on the current node. - If is reached, a is thrown - instead of continuing and crashing with a . - - - - - Gets the type of node. - - - - - Performs an implicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an implicit conversion from string[] to . - - The value. - The result of the conversion. - - - - Converts a to a string by returning its value. - - - - - Gets the nth element in a . - - - - - Gets the value associated with a key in a . - - - - - Comparer that is based on identity comparisons. - - - - - - - - - - - Specifies the type of node in the representation model. - - - - - The node is a . - - - - - The node is a . - - - - - The node is a . - - - - - The node is a . - - - - - Represents a scalar node in the YAML document. - - - - - Gets or sets the value of the node. - - The value. - - - - Gets or sets the style of the node. - - The style. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The value. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Recursively enumerates all the nodes from the document, starting on the current node, - and throwing - if is reached. - - - - - Gets the type of node. - - - - - Represents a sequence node in the YAML document. - - - - - Gets the collection of child nodes. - - The children. - - - - Gets or sets the style of the node. - - The style. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Adds the specified child to the collection. - - The child. - - - - Adds a scalar node to the collection. - - The child. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Recursively enumerates all the nodes from the document, starting on the current node, - and throwing - if is reached. - - - - - Gets the type of node. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - - - - Represents an YAML stream. - - - - - Gets the documents inside the stream. - - The documents. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Adds the specified document to the collection. - - The document. - - - - Loads the stream from the specified input. - - The input. - - - - Loads the stream from the specified . - - - - - Saves the stream to the specified output. - - The output. - - - - Saves the stream to the specified output. - - The output. - Indicates whether or not to assign node anchors. - - - - Saves the stream to the specified emitter. - - The emitter. - Indicates whether or not to assign node anchors. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Abstract implementation of that knows how to walk a complete Yaml object model. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Abstract implementation of that knows how to walk a complete YAML object model. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called when this object is visiting a key-value pair. - - The left (key) that is being visited. - The right (value) that is being visited. - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Wraps a instance and allows it to be buffered as a LinkedList in memory and replayed. - - - - - Initializes a new instance of the class. - - The Parser to buffer. - The maximum depth of the parser to buffer before raising an ArgumentOutOfRangeException. - The maximum length of the LinkedList can buffer before raising an ArgumentOutOfRangeException. - If parser does not fit within the max depth and length specified. - - - - Gets the current event. Returns null after returns false. - - - - - Moves to the next event. - - Returns true if there are more events available, otherwise returns false. - - - - Resets the buffer back to it's first event. - - - - - The TypeDiscriminatingNodeDeserializer acts as a psuedo . - If any of it's has a matching BaseType, the TypeDiscriminatingNodeDeserializer will - begin buffering the yaml stream. It will then use the matching s to determine - a dotnet output type for the yaml node. As the node is buffered, the s are - able to examine the actual values within, and use these when discriminating a type. - Once a matching type is found, the TypeDiscriminatingNodeDeserializer uses it's inner deserializers to perform - the final deserialization for that type & object. - Usually you will want all default s that exist in the outer - to also be used as inner deserializers. - - - - - Adds an to be checked by the TypeDiscriminatingNodeDeserializer. - - The to add. - - - - Adds a to be checked by the TypeDiscriminatingNodeDeserializer. - s use the value of a specified key on the yaml object to map - to a target type. - - The yaml key to discriminate on. - A dictionary of values for the yaml key mapping to their respective types. - - - - Adds a to be checked by the TypeDiscriminatingNodeDeserializer. - s use the presence of unique keys on the yaml object to map - to different target types. - - A dictionary of unique yaml keys mapping to their respective types. - - - - An ITypeDiscriminator provides an interface for discriminating which dotnet type to deserialize a yaml - stream into. They require the yaml stream to be buffered as they - can inspect the yaml value, determine the desired type, and reset the yaml stream to then deserialize into - that type. - - - - - Gets the BaseType of the discriminator. All types that an ITypeDiscriminator may discriminate into must - inherit from this type. This enables the deserializer to only buffer values of matching types. - If you would like an ITypeDiscriminator to discriminate all yaml values, the BaseType will be object. - - - - - Trys to discriminate a type from the current IParser. As discriminating the type will consume the parser, the - parser will usually need to be a buffer so an instance of the discriminated type can be deserialized later. - - The IParser to consume and discriminate a type from. - The output type discriminated. Null if no type matched the discriminator. - Returns true if the discriminator matched the yaml stream. - - - - A TypeDiscriminator that discriminates which type to deserialize a yaml stream into by checking the value - of a known key. - - - - - Initializes a new instance of the class. - The KeyValueTypeDiscriminator will check the target key specified, and if it's value is contained within the - type mapping dictionary, the coresponding type will be discriminated. - - The base type which all discriminated types will implement. Use object if you're discriminating - unrelated types. Note the less specific you are with the base type the more yaml will need to be buffered. - The known key to check the value of when discriminating. - A mapping dictionary of yaml values to types. - If any of the target types do not implement the base type. - - - - Checks if the current parser contains the target key, and that it's value matches one of the type mappings. - If so, return true, and the matching type. - Otherwise, return false. - This will consume the parser, so you will usually need the parser to be a buffer so an instance - of the discriminated type can be deserialized later. - - The IParser to consume and discriminate a type from. - The output type discriminated. Null if there target key was not present of if the value - of the target key was not within the type mapping. - Returns true if the discriminator matched the yaml stream. - - - - A TypeDiscriminator that discriminates which type to deserialize a yaml stream into by checking the existence - of specific keys. - - - - - Initializes a new instance of the class. - The UniqueKeyTypeDiscriminator will check if any of the keys specified exist, and discriminate the coresponding type. - - The base type which all discriminated types will implement. Use object if you're discriminating - unrelated types. Note the less specific you are with the base type the more yaml will need to be buffered. - A mapping dictionary of yaml keys to types. - If any of the target types do not implement the base type. - - - - Checks if the current parser contains of the unique keys this discriminator has in it's type mapping. - If so, return true, and the matching type. - Otherwise, return false. - This will consume the parser, so you will usually need the parser to be a buffer so an instance - of the discriminated type can be deserialized later. - - The IParser to consume and discriminate a type from. - The output type discriminated. Null if there target key was not present of if the value - of the target key was not within the type mapping. - Returns true if the discriminator matched the yaml stream. - - - - Common implementation of and . - - - - - Prevents serialization and deserialization of fields. - - - - - - Allows serialization and deserialization of non-public properties. - - - - - Calling this will enable the support for private constructors when considering serialization and deserialization. - - - - - Sets the that will be used by the (de)serializer. - - - - - Sets the to use when handling enum's. - - Naming convention to use when handling enum's - - - - - Sets the that will be used by the (de)serializer. - - - - - Register an for a given property. - - - An expression in the form: x => x.SomeProperty - The attribute to register. - - - - - Register an for a given property. - - - - - Registers an additional to be used by the (de)serializer. - - - - - Registers an additional to be used by the (de)serializer. - - - Configures the location where to insert the - - - - Registers an additional to be used by the (de)serializer. - - A factory that creates the based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers an additional to be used by the (de)serializer. - - A function that instantiates the type inspector. - - - - Registers an additional to be used by the (de)serializer. - - A function that instantiates the type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the (de)serializer. - - A function that instantiates the type inspector based on a previously registered .. - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Override the default yaml formatter with the one passed in - - to use when serializing and deserializing objects. - - - - - - A factory that creates instances of based on an existing . - - The type of the wrapped component. - The type of the component that this factory creates. - The component that is to be wrapped. - Returns a new instance of that is based on . - - - - A factory that creates instances of based on an existing and an argument. - - The type of the argument. - The type of the wrapped component. - The type of the component that this factory creates. - The component that is to be wrapped. - The argument of the factory. - Returns a new instance of that is based on and . - - - - This represents the YAML converter entity for using the ISO-8601 standard format. - - - - - Initializes a new instance of the class using the default any scalar style. - - - - - Initializes a new instance of the class. - - - - - Gets a value indicating whether the current converter supports converting the specified type. - - to check. - Returns True, if the current converter supports; otherwise returns False. - - - - Reads an object's state from a YAML parser. - - instance. - to convert. - The deserializer to use to deserialize complex types. - Returns the instance converted. - On deserializing, all formats in the list are used for conversion. - - - - Writes the specified object's state to a YAML emitter. - - instance. - Value to write. - to convert. - A serializer to serializer complext objects. - On serializing, the first format in the list is used. - - - - This represents the YAML converter entity for . - - - - - Initializes a new instance of the class. - - value. Default value is . is considered as . - instance. Default value is . - If true, will use double quotes when writing the value to the stream. - List of date/time formats for parsing. Default value is "G". - On deserializing, all formats in the list are used for conversion, while on serializing, the first format in the list is used. - - - - Gets a value indicating whether the current converter supports converting the specified type. - - to check. - Returns True, if the current converter supports; otherwise returns False. - - - - Reads an object's state from a YAML parser. - - instance. - to convert. - The deserializer to use to deserialize complex types. - Returns the instance converted. - On deserializing, all formats in the list are used for conversion. - - - - Writes the specified object's state to a YAML emitter. - - instance. - Value to write. - to convert. - A serializer to serializer complext objects. - On serializing, the first format in the list is used. - - - - Converts the object to a string representation - To use this converter, call WithTypeConverter(new DateTimeOffsetConverter()) on the - or . - - - - - Initializes a new instance of the class. - - instance. Default value is . - If true, will use double quotes when writing the value to the stream. - - List of date/time formats for parsing. Default value is "O". - On deserializing, all formats in the list are used for conversion, while on serializing, the first format in the list is used. - - - - Gets a value indicating whether the current converter supports converting the specified type. - - to check. - Returns True, if the current converter supports; otherwise returns False. - - - - Reads an object's state from a YAML parser. - - instance. - to convert. - The deserializer to use to deserialize complex types. - Returns the instance converted. - On deserializing, all formats in the list are used for conversion. - - - - Writes the specified object's state to a YAML emitter. - - instance. - Value to write. - to convert. - A serializer to serializer complext objects. - On serializing, the first format in the list is used. - - - - Converter for System.Guid. - - - - - Converter for System.Type. - - - Converts to a scalar containing the assembly qualified name of the type. - - - - - Specifies the strategy to handle default and null values during serialization of properties. - - - - - Specifies that all properties are to be emitted regardless of their value. This is the default behavior. - - - - - Specifies that properties that contain null references or a null Nullable<T> are to be omitted. - - - - - Specifies that properties that that contain their default value, either default(T) or the value specified in DefaultValueAttribute are to be omitted. - - - - - Specifies that properties that that contain collections/arrays/enumerations that are empty are to be omitted. - - - - - Deserializes objects from the YAML format. - To customize the behavior of , - use the class. - - - - - Initializes a new instance of using the default configuration. - - - To customize the behavior of the deserializer, use . - - - - - This constructor is private to discourage its use. - To invoke it, call the method. - - - - - Creates a new that uses the specified . - This method is available for advanced scenarios. The preferred way to customize the behavior of the - deserializer is to use . - - - - - Deserializes an object of the specified type. - - The from where to deserialize the object. - The static type of the object to deserialize. - Returns the deserialized object. - - - - Creates and configures instances of . - This class is used to customize the behavior of . Use the relevant methods - to apply customizations, then call to create an instance of the deserializer - with the desired customizations. - - - - - Initializes a new using the default component registrations. - - - - - Builds the type inspector used by various classes to get information about types and their members. - - - - - - When deserializing it will attempt to convert unquoted strings to their correct datatype. If conversion is not sucessful, it will leave it as a string. - This option is only applicable when not specifying a type or specifying the object type during deserialization. - - - - - Sets the that will be used by the deserializer. - - - - - Sets the that will be used by the deserializer. - - - - - Registers an additional to be used by the deserializer. - - - - - Registers an additional to be used by the deserializer. - - - Configures the location where to insert the - - - - Registers an additional to be used by the deserializer. - - A factory that creates the based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers a to be used by the deserializer. This internally registers - all existing as inner deserializers available to the . - Usually you will want to call this after any other changes to the s used by the deserializer. - - An action that can configure the . - Configures the max depth of yaml nodes that will be buffered. A value of -1 (the default) means yaml nodes of any depth will be buffered. - Configures the max number of yaml nodes that will be buffered. A value of -1 (the default) means there is no limit on the number of yaml nodes buffered. - - - - Registers an additional to be used by the deserializer. - - - - - Registers an additional to be used by the deserializer. - - - Configures the location where to insert the - - - - Registers an additional to be used by the deserializer. - - A factory that creates the based on a previously registered . - Configures the location where to insert the - - - - Ignore case when matching property names. - - - - - - Enforce whether null values can be set on non-nullable properties and fields. - - This deserializer builder. - - - - Require that all members with the 'required' keyword be set by YAML. - - - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers a tag mapping. - - - - - Registers a type mapping using the default object factory. - - - - - Unregisters an existing tag mapping. - - - - - Instructs the deserializer to ignore unmatched properties instead of throwing an exception. - - - - - Instructs the deserializer to check for duplicate keys and throw an exception if duplicate keys are found. - - - - - - Creates a new according to the current configuration. - - - - - Creates a new that implements the current configuration. - This method is available for advanced scenarios. The preferred way to customize the behavior of the - deserializer is to use the method. - - - - - Gets the next visitor that should be called by the current visitor. - - - - - Gets the that is to be used for serialization. - - - - - Gets a function that, when called, serializes the specified object. - - - - - Gets the visitor of type that was used during the pre-processing phase. - - The type of the visitor.s - - - No visitor of that type has been registered, - or ore than one visitors registered are of type . - - - - - Provided the base implementation for an IEventEmitter that is a - decorator for another IEventEmitter. - - - - - This pattern matches strings that are special both in YAML 1.1 and 1.2 - - - - - Deserializes an object of the specified type. - - The from where to deserialize the object. - The static type of the object to deserialize. - Returns the deserialized object. - - - - Translates property names according to a specific convention. - - - - - Determines the type of the specified node. - - The node to be deserialized. - The type that has been determined so far. - - true if has been resolved completely; - false if the next type should be invoked. - - - - - The interface to implement for getting/setting an objects fields and properties when using a static context - - - - - Set a field/property value - - Name of the field or property. - Object to set the field/property on. - Value to set the field/property to. - - - - Reads a value from a field/property - - Name of the field or property. - Object to get the field/property from. - - - - - Represents an object along with its type. - - - - - A reference to the object. - - - - - The type that should be used when to interpret the . - - - - - The type of as determined by its container (e.g. a property). - - - - - The style to be used for scalars. - - - - - Returns the Value property of the if it is not null. - This is useful in all places that the value must not be null. - - An object descriptor. - Thrown when the Value is null - - - - - Creates instances of types. - - - This interface allows to provide a custom logic for creating instances during deserialization. - - - - - Creates an instance of the specified type. - - - - - Creates a default value for the .net primitive types (string, int, bool, etc) - - - - - - - If the type is convertable to a non generic dictionary, then it will do so and set dictionary and genericArguments to the correct values and return true. - If not, values will be null and the result will be false.. - - Object descriptor to try and convert - The converted dictionary - Generic type arguments that specify the key and value type - True if converted, false if not - - - - Gets the type of the value part of a dictionary or list. - - - - - - - Executes the methods on the object that has the attribute - - - - - - Executes the methods on the object that has the attribute - - - - - - Executes the methods on the object that has the attribute - - - - - - Executes the methods on the object that has the attribute - - - - - - Defines a strategy that walks through an object graph. - - - - - Traverses the specified object graph. - - The graph. - An that is to be notified during the traversal. - A that will be passed to the . - The serializer to use to serialize complex objects. - - - - Defined the interface of a type that can be notified during an object graph traversal. - - - - - Indicates whether the specified value should be entered. This allows the visitor to - override the handling of a particular object or type. - - The value that is about to be entered. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - The descriptor for the property that the value belongs to. - If the value is to be entered, returns true; otherwise returns false; - - - - Indicates whether the specified mapping should be entered. This allows the visitor to - override the handling of a particular pair. - - The key of the mapping that is about to be entered. - The value of the mapping that is about to be entered. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - If the mapping is to be entered, returns true; otherwise returns false; - - - - Indicates whether the specified mapping should be entered. This allows the visitor to - override the handling of a particular pair. This overload should be invoked when the - mapping is produced by an object's property. - - The that provided access to . - The value of the mapping that is about to be entered. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - If the mapping is to be entered, returns true; otherwise returns false; - - - - Notifies the visitor that a scalar value has been encountered. - - The value of the scalar. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - - - - Notifies the visitor that the traversal of a mapping is about to begin. - - The value that corresponds to the mapping. - The static type of the keys of the mapping. - The static type of the values of the mapping. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - - - - Notifies the visitor that the traversal of a mapping has ended. - - The value that corresponds to the mapping. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - - - - Notifies the visitor that the traversal of a sequence is about to begin. - - The value that corresponds to the sequence. - The static type of the elements of the sequence. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - - - - Notifies the visitor that the traversal of a sequence has ended. - - The value that corresponds to the sequence. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - - - - Registers the component in place of the already registered component of type . - - - - - Registers the component before the already registered component of type . - - - - - Registers the component after the already registered component of type . - - - - - Registers the component before every other previously registered component. - - - - - Registers the component after every other previously registered component. - - - - - Registers the component in place of the already registered component of type . - - - - - Serializes the specified object into a string. - - The object to serialize. - - - - Serializes the specified object into a string. - - The object to serialize. - The static type of the object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - The static type of the object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - The static type of the object to serialize. - - - - Provides access to the properties of a type. - - - - - Gets all properties of the specified type. - - The type whose properties are to be enumerated. - The actual object of type whose properties are to be enumerated. Can be null. - - - - - Gets the property of the type with the specified name. - - The type whose properties are to be searched. - The actual object of type whose properties are to be searched. Can be null. - The name of the property. - - Determines if an exception or null should be returned if can't be - found in - - If true use case-insitivity when choosing the property or field. - - - - - Returns the actual name from the EnumMember attribute - - The type of the enum. - The name to lookup. - The actual name of the enum value. - - - - Return the value of the enum - - - - - - - Resolves the type of values. - - - - - Allows an object to customize how it is serialized and deserialized. - - - - - Reads this object's state from a YAML parser. - - The parser where the object's state should be read from. - The type that the deserializer is expecting. - - A function that will use the current deserializer - to read an object of the given type from the parser. - - - - - Writes this object's state to a YAML emitter. - - The emitter where the object's state should be written to. - A function that will use the current serializer to write an object to the emitter. - - - - Represents a function that is used to deserialize an object of the given type. - - The type that the deserializer should read. - Returns the object that was deserialized. - - - - Represents a function that is used to serialize an object of the given type. - - The object to be serialized. - - The type that should be considered when emitting the object. - If null, the actual type of the is used. - - - - - Allows an object to customize how it is serialized and deserialized. - - - - - Reads this object's state from a YAML parser. - - - - - Writes this object's state to a YAML emitter. - - - - - Allows to customize how a type is serialized and deserialized. - - - - - Gets a value indicating whether the current converter supports converting the specified type. - - - - - Reads an object's state from a YAML parser. - - - - - Writes the specified object's state to a YAML emitter. - - - - - Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to - camel case (thisIsATest). Camel case is the same as Pascal case, except the first letter - is lowercase. - - - - - Convert the string from camelcase (thisIsATest) to a hyphenated (this-is-a-test) string - - - - - Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to - lower case (thisisatest). - - - - - Performs no naming conversion. - - - - - Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to - pascal case (ThisIsATest). Pascal case is the same as camel case, except the first letter - is uppercase. - - - - - Convert the string from camelcase (thisIsATest) to a underscored (this_is_a_test) string - - - - - An empty type for cases where a type needs to be provided but won't be used. - - - - - Creates objects using Activator.CreateInstance. - - - - - Creates objects using a Func{Type,object}"/>. - - - - - - - - - - - - - - - - - Gets information about and creates statically known, serializable, types. - - - - - Create an object of the specified type - - Type of object to create - - - - - Creates an array of the specified type with the size specified - - The type of the array, should be the whole type, not just the value type - How large the array should be - - - - - Gets whether the type is a dictionary or not - - Type to check - - - - - Gets whether the type is an array or not - - Type to check - - - - - Gets whether the type is a list - - Type to check - - - - - Gets the type of the key of a dictionary - - - - - - - Gets the type of the value part of a dictionary or list. - - - - - - - Creates the default value of primitive types - - - - - - - The static implementation of yamldotnet doesn't support generating types, so we will return null's and false since we can't do anything. - - - - - - - - - An implementation of that traverses - readable properties, collections and dictionaries. - - - - - An implementation of that traverses - properties that are read/write, collections and dictionaries, while ensuring that - the graph can be regenerated from the resulting document. - - - - - A factory method for creating instances - - The type inspector to be used by the traversal strategy. - The type resolver to be used by the traversal strategy. - The type converters to be used by the traversal strategy. - The maximum object depth to be supported by the traversal strategy. - - - - - A base class that simplifies the correct implementation of . - - - - - Initializes a new instance of using the default configuration. - - - To customize the behavior of the serializer, use . - - - - - This constructor is private to discourage its use. - To invoke it, call the method. - - - - - Creates a new that uses the specified . - This method is available for advanced scenarios. The preferred way to customize the behavior of the - deserializer is to use . - - - - - Serializes the specified object into a string. - - The object to serialize. - - - - Serializes the specified object into a string. - - The object to serialize. - The static type of the object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - The static type of the object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - The static type of the object to serialize. - - - - Creates and configures instances of . - This class is used to customize the behavior of . Use the relevant methods - to apply customizations, then call to create an instance of the serializer - with the desired customizations. - - - - - Put double quotes around strings that need it, for example Null, True, False, a number. This should be called before any other "With" methods if you want this feature enabled. - - Also quote strings that are valid scalars in the YAML 1.1 specification (which includes boolean Yes/No/On/Off, base 60 numbers and more) - - - - Sets the default quoting style for scalar values. The default value is - - - - - Sets the maximum recursion that is allowed while traversing the object graph. The default value is 50. - - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers a tag mapping. - - - - - Unregisters an existing tag mapping. - - - - - Ensures that it will be possible to deserialize the serialized objects. - This option will force the emission of tags and emit only properties with setters. - - - - - Specifies that, if the same object appears more than once in the - serialization graph, it will be serialized each time instead of just once. - - - If the serialization graph contains circular references and this flag is set, - a StackOverflowException will be thrown. - If this flag is not set, there is a performance penalty because the entire - object graph must be walked twice. - - - - - Forces every value to be serialized, even if it is the default value for that type. - - - - - Configures how properties with default and null values should be handled. The default value is DefaultValuesHandling.Preserve - - - If more control is needed, create a class that extends from ChainedObjectGraphVisitor and override its EnterMapping methods. - Then register it as follows: - WithEmissionPhaseObjectGraphVisitor(args => new MyDefaultHandlingStrategy(args.InnerVisitor)); - - - - - Ensures that the result of the serialization is valid JSON. - - - - - Allows you to override the new line character to use when serializing to YAML. - - NewLine character(s) to use when serializing to YAML. - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - The type inspector. - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector. - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - The type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector based on a previously registered . - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers an to be used by the serializer - while traversing the object graph. - - A function that instantiates the traversal strategy. - - - - Registers an additional to be used by the serializer - while emitting an object graph. - - A function that instantiates the type inspector. - - - - Registers an additional to be used by the serializer - while emitting an object graph. - - A function that instantiates the type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - while emitting an object graph. - - A function that instantiates the type inspector based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Creates sequences with extra indentation - - - list: - - item - - item - - - - - - Creates a new according to the current configuration. - - - - - Creates a new that implements the current configuration. - This method is available for advanced scenarios. The preferred way to customize the behavior of the - deserializer is to use the method. - - - - - Builds the type inspector used by various classes to get information about types and their members. - - - - - - If true then private, parameterless constructors will be invoked if a public one is not available. - - - - - Common implementation of and . - - - - - Sets the that will be used by the (de)serializer. - - - - - Sets the to use when handling enum's. - - Naming convention to use when handling enum's - - - - - Sets the that will be used by the (de)serializer. - - - - - Registers an additional to be used by the (de)serializer. - - - - - Registers an additional to be used by the (de)serializer. - - - Configures the location where to insert the - - - - Registers an additional to be used by the (de)serializer. - - A factory that creates the based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers an additional to be used by the (de)serializer. - - A function that instantiates the type inspector. - - - - Registers an additional to be used by the (de)serializer. - - A function that instantiates the type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the (de)serializer. - - A function that instantiates the type inspector based on a previously registered .. - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Override the default yaml formatter with the one passed in - - to use when serializing and deserializing objects. - - - - - - Holds the static object factory and type inspector to use when statically serializing/deserializing YAML. - - - - - Gets whether the type is known to the context - - Type to check - - - - - Gets the to use for serialization - - - - - - Gets the factory to use for serialization and deserialization - - - - - - Gets the type inspector to use when statically serializing/deserializing YAML. - - - - - - Creates and configures instances of . - This class is used to customize the behavior of . Use the relevant methods - to apply customizations, then call to create an instance of the deserializer - with the desired customizations. - - - - - Initializes a new using the default component registrations. - - - - - Builds the type inspector used by various classes to get information about types and their members. - - - - - - When deserializing it will attempt to convert unquoted strings to their correct datatype. If conversion is not sucessful, it will leave it as a string. - This option is only applicable when not specifying a type or specifying the object type during deserialization. - - - - - Registers an additional to be used by the deserializer. - - - - - Registers an additional to be used by the deserializer. - - - Configures the location where to insert the - - - - Registers an additional to be used by the deserializer. - - A factory that creates the based on a previously registered . - Configures the location where to insert the - - - - Ignore case when matching property names. - - - - - - Enforce whether null values can be set on non-nullable properties and fields. - - This static deserializer builder. - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers a to be used by the deserializer. This internally registers - all existing as inner deserializers available to the . - Usually you will want to call this after any other changes to the s used by the deserializer. - - An action that can configure the . - Configures the max depth of yaml nodes that will be buffered. A value of -1 (the default) means yaml nodes of any depth will be buffered. - Configures the max number of yaml nodes that will be buffered. A value of -1 (the default) means there is no limit on the number of yaml nodes buffered. - - - - Registers an additional to be used by the deserializer. - - - - - Registers an additional to be used by the deserializer. - - - Configures the location where to insert the - - - - Registers an additional to be used by the deserializer. - - A factory that creates the based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers a tag mapping. - - - - - Registers a type mapping using the default object factory. - - - - - Unregisters an existing tag mapping. - - - - - Instructs the deserializer to ignore unmatched properties instead of throwing an exception. - - - - - Instructs the deserializer to check for duplicate keys and throw an exception if duplicate keys are found. - - - - - - Creates a new according to the current configuration. - - - - - Creates a new that implements the current configuration. - This method is available for advanced scenarios. The preferred way to customize the behavior of the - deserializer is to use the method. - - - - - Creates and configures instances of . - This class is used to customize the behavior of . Use the relevant methods - to apply customizations, then call to create an instance of the serializer - with the desired customizations. - - - - - Put double quotes around strings that need it, for example Null, True, False, a number. This should be called before any other "With" methods if you want this feature enabled. - - Also quote strings that are valid scalars in the YAML 1.1 specification (which includes boolean Yes/No/On/Off, base 60 numbers and more) - - - - Put double quotes around strings that need it, for example Null, True, False, a number. This should be called before any other "With" methods if you want this feature enabled. - - - - - Sets the default quoting style for scalar values. The default value is - - - - - Sets the maximum recursion that is allowed while traversing the object graph. The default value is 50. - - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers a tag mapping. - - - - - Unregisters an existing tag mapping. - - - - - Ensures that it will be possible to deserialize the serialized objects. - This option will force the emission of tags and emit only properties with setters. - - - - - Specifies that, if the same object appears more than once in the - serialization graph, it will be serialized each time instead of just once. - - - If the serialization graph contains circular references and this flag is set, - a StackOverflowException will be thrown. - If this flag is not set, there is a performance penalty because the entire - object graph must be walked twice. - - - - - Forces every value to be serialized, even if it is the default value for that type. - - - - - Configures how properties with default and null values should be handled. The default value is DefaultValuesHandling.Preserve - - - If more control is needed, create a class that extends from ChainedObjectGraphVisitor and override its EnterMapping methods. - Then register it as follows: - WithEmissionPhaseObjectGraphVisitor(args => new MyDefaultHandlingStrategy(args.InnerVisitor)); - - - - - Ensures that the result of the serialization is valid JSON. - - - - - Allows you to override the new line character to use when serializing to YAML. - - NewLine character(s) to use when serializing to YAML. - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - The type inspector. - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector. - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - The type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector based on a previously registered . - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers an to be used by the serializer - while traversing the object graph. - - A function that instantiates the traversal strategy. - - - - Registers an additional to be used by the serializer - while emitting an object graph. - - A function that instantiates the type inspector. - - - - Registers an additional to be used by the serializer - while emitting an object graph. - - A function that instantiates the type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - while emitting an object graph. - - A function that instantiates the type inspector based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Creates sequences with extra indentation - - - list: - - item - - item - - - - - - Creates a new according to the current configuration. - - - - - Creates a new that implements the current configuration. - This method is available for advanced scenarios. The preferred way to customize the behavior of the - deserializer is to use the method. - - - - - Builds the type inspector used by various classes to get information about types and their members. - - - - - - An object that contains part of a YAML stream. - - - - - Gets or sets the events. - - The events. - - - - Reads this object's state from a YAML parser. - - - - - Writes this object's state to a YAML emitter. - - - - - Contains mappings between tags and types. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The mappings. - - - - Adds the specified tag. - - The tag. - The mapping. - - - - Gets the mapping. - - The tag. - - - - - Wraps another and applies caching. - - - - - Aggregates the results from multiple into a single one. - - - - - Wraps another and applies a - naming convention to the names of the properties. - - - - - Returns the properties of a type that are both readable and writable. - - - - - Returns the properties and fields of a type that are readable. - - - - - Returns the properties of a type that are readable. - - - - - Returns the properties of a type that are writable. - - - - - The type returned will be the actual type of the value, if available. - - - - - Except for primitive types, the type returned will always be the static type. - - - - - Indicates that a class used as deserialization state - needs to be notified after deserialization. - - - - - Convert a value to a specified type - - - - Naming convention to use on enums in the type converter. - The type inspector to use when getting information about a type. - - - - - Adds the specified anchor. - - The anchor. - The @object. - - - - Gets the anchor for the specified object. - - The object. - The anchor. - - - - - Gets the with the specified anchor. - - - - - - A generic container that is preserved during the entire deserialization process. - Any disposable object added to this collection will be disposed when this object is disposed. - - - - - Invokes on all - objects added to this collection that implement . - - - - - Various string extension methods - - - - - Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to - camel case (thisIsATest). Camel case is the same as Pascal case, except the first letter - is lowercase. - - String to convert - Converted string - - - - Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to - pascal case (ThisIsATest). Pascal case is the same as camel case, except the first letter - is uppercase. - - String to convert - Converted string - - - - Convert the string from camelcase (thisIsATest) to a hyphenated (this-is-a-test) or - underscored (this_is_a_test) string - - String to convert - Separator to use between segments - Converted string - - - - Performs type conversions using every standard provided by the .NET library. - - - - - Converts the specified value. - - The type to which the value is to be converted. - The value to convert. - Naming convention to apply to enums. - The type inspector to use when getting information about a type. - - - - - Converts the specified value using the invariant culture. - - The value to convert. - The type to which the value is to be converted. - Naming convention to apply to enums. - The type inspector to use when getting information about a type. - - - - - Converts the specified value. - - The value to convert. - The type to which the value is to be converted. - The format provider. - Naming convention to apply to enums. - The type inspector to use when getting information about a type. - - - - - Converts the specified value. - - The value to convert. - The type to which the value is to be converted. - The culture. - Naming convention to apply to enums. - The type inspector to use when getting information about a type. - - - - - Registers a dynamically. - - The type to which the converter should be associated. - The type of the converter. - - - - Define a collection of YamlAttribute Overrides for pre-defined object types. - - - - - Checks whether this mapping matches the specified type, and returns a value indicating the match priority. - - The priority of the match. Higher values have more priority. Zero indicates no match. - - - - Adds a Member Attribute Override - - Type - Class Member - Overriding Attribute - - - - Creates a copy of this instance. - - - - - Adds a Member Attribute Override - - - - - Applies the Yaml attribute overrides to another . - - - - - Applies the Yaml* attributes to another . - - - - - Converts an enum to it's string representation. - By default it will be the string representation of the enum passed through the naming convention. - - A string representation of the enum - - - - If this function returns true, the serializer will put quotes around the formatted enum value if necessary. Defaults to true. - - - - - Instructs the YamlSerializer not to serialize the public field or public read/write property value. - - - - - Provides special Yaml serialization instructions. - - - - - Decription/Comment about this property. - When set, a comment will be emitted when serializing this member. - - - - - Specifies that this property should be serialized as the given type, rather than using the actual runtime value's type. - - - - - Specifies the order priority of this property. - - - - - Instructs the to use a different field name for serialization. - - - - - When false, naming conventions will not be applied to this member. Defaults to true. - - - - - Specifies the scalar style of the property when serialized. This will only affect the serialization of scalar properties. - - - - - Overrides how null and default values should be handled for this property. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - Specifies that this property should be serialized as the given type, rather than using the actual runtime value's type. - - - - Put this attribute either on serializable types or on the that you want - the static analyzer to detect and use. - - - - - Use this constructor if the attribute is placed on a serializable class. - - - - - Use this constructor if the attribute is placed on the . - - The type for which to include static code generation. - - - diff --git a/lib/net47/LICENSE.txt b/lib/netstandard2.0/LICENSE.txt similarity index 100% rename from lib/net47/LICENSE.txt rename to lib/netstandard2.0/LICENSE.txt diff --git a/lib/netstandard2.1/PowerShellYamlSerializer.dll b/lib/netstandard2.0/PowerShellYamlSerializer.dll similarity index 89% rename from lib/netstandard2.1/PowerShellYamlSerializer.dll rename to lib/netstandard2.0/PowerShellYamlSerializer.dll index a2c4acf..a27bb44 100644 Binary files a/lib/netstandard2.1/PowerShellYamlSerializer.dll and b/lib/netstandard2.0/PowerShellYamlSerializer.dll differ diff --git a/lib/netstandard2.0/YamlDotNet.dll b/lib/netstandard2.0/YamlDotNet.dll new file mode 100644 index 0000000..c496141 Binary files /dev/null and b/lib/netstandard2.0/YamlDotNet.dll differ diff --git a/lib/netstandard2.1/LICENSE.txt b/lib/netstandard2.1/LICENSE.txt deleted file mode 100644 index d4f2924..0000000 --- a/lib/netstandard2.1/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 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. diff --git a/lib/netstandard2.1/YamlDotNet.dll b/lib/netstandard2.1/YamlDotNet.dll deleted file mode 100644 index 06c77a7..0000000 Binary files a/lib/netstandard2.1/YamlDotNet.dll and /dev/null differ diff --git a/lib/netstandard2.1/YamlDotNet.xml b/lib/netstandard2.1/YamlDotNet.xml deleted file mode 100644 index aa0e99e..0000000 --- a/lib/netstandard2.1/YamlDotNet.xml +++ /dev/null @@ -1,6039 +0,0 @@ - - - - YamlDotNet - - - - - The exception that is thrown when an alias references an anchor that does not exist. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Defines constants that relate to the YAML specification. - - - - - Emits YAML streams. - - - - - Initializes a new instance of the class. - - The where the emitter will write. - - - - Initializes a new instance of the class. - - The where the emitter will write. - The preferred indentation. - - - - Initializes a new instance of the class. - - The where the emitter will write. - The preferred indentation. - The preferred text width. - - - - Initializes a new instance of the class. - - The where the emitter will write. - The preferred indentation. - The preferred text width. - If true, write the output in canonical form. - - - - Emit an evt. - - - - - Check if we need to accumulate more events before emitting. - - We accumulate extra - - 1 event for DOCUMENT-START - - 2 events for SEQUENCE-START - - 3 events for MAPPING-START - - - - - Expect STREAM-START. - - - - - Expect DOCUMENT-START or STREAM-END. - - - - - Expect the root node. - - - - - Expect a node. - - - - - Expect ALIAS. - - - - - Expect SCALAR. - - - - - Expect SEQUENCE-START. - - - - - Expect MAPPING-START. - - - - - Expect DOCUMENT-END. - - - - - Expect a flow item node. - - - - - Expect a flow key node. - - - - - Expect a flow value node. - - - - - Expect a block item node. - - - - - Expect a block key node. - - - - - Expect a block value node. - - - - - Check if the document content is an empty scalar. - - - - - Check if the next node can be expressed as a simple key. - - - - - The preferred indentation. - - - - - The preferred text width. - - - - - New line characters. - - - - - If true, write the output in canonical form. - - - - - If true, write output without anchor names. - - - - - The maximum allowed length for simple keys. - - - The specifiction mandates 1024 characters, but any desired value may be used. - - - - - Indent sequences. The default is to not indent. - - - - - Represents an alias event. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets the value of the alias. - - - - - Initializes a new instance of the class. - - The value of the alias. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - The value of the alias. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Represents a document end event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets a value indicating whether this instance is implicit. - - - true if this instance is implicit; otherwise, false. - - - - - Initializes a new instance of the class. - - Indicates whether the event is implicit. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - Indicates whether the event is implicit. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Represents a document start event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets the tags. - - The tags. - - - - Gets the version. - - The version. - - - - Gets a value indicating whether this instance is implicit. - - - true if this instance is implicit; otherwise, false. - - - - - Initializes a new instance of the class. - - The version. - The tags. - Indicates whether the event is implicit. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - The version. - The tags. - Indicates whether the event is implicit. - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Callback interface for external event Visitor. - - - - - Represents a mapping end event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Represents a mapping start event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets a value indicating whether this instance is implicit. - - - true if this instance is implicit; otherwise, false. - - - - - Gets a value indicating whether this instance is canonical. - - - - - - Gets the style of the mapping. - - - - - Initializes a new instance of the class. - - The anchor. - The tag. - Indicates whether the event is implicit. - The style of the mapping. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - The anchor. - The tag. - Indicates whether the event is implicit. - The style of the mapping. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Specifies the style of a mapping. - - - - - Let the emitter choose the style. - - - - - The block mapping style. - - - - - The flow mapping style. - - - - - Contains the behavior that is common between node events. - - - - - Gets the anchor. - - - - - - Gets the tag. - - - - - - Gets a value indicating whether this instance is canonical. - - - - - - Initializes a new instance of the class. - - The anchor. - The tag. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Base class for parsing events. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets the position in the input stream where the event starts. - - - - - Gets the position in the input stream where the event ends. - - - - - Accepts the specified visitor. - - Visitor to accept, may not be null - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Represents a scalar event. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets the value. - - The value. - - - - Gets the style of the scalar. - - The style. - - - - Gets a value indicating whether the tag is optional for the plain style. - - - - - Gets a value indicating whether the tag is optional for any non-plain style. - - - - - Gets a value indicating whether this instance is canonical. - - - - - - Gets whether this scalar event is a key - - - - - Initializes a new instance of the class. - - The anchor. - The tag. - The value. - The style. - . - . - The start position of the event. - The end position of the event. - Whether or not this scalar event is for a key - - - - Initializes a new instance of the class. - - The anchor. - The tag. - The value. - The style. - . - . - - - - Initializes a new instance of the class. - - The value. - - - - Initializes a new instance of the class. - - The tag. - The value. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Represents a sequence end event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Represents a sequence start event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets a value indicating whether this instance is implicit. - - - true if this instance is implicit; otherwise, false. - - - - - Gets a value indicating whether this instance is canonical. - - - - - - Gets the style. - - The style. - - - - Initializes a new instance of the class. - - The anchor. - The tag. - if set to true [is implicit]. - The style. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Specifies the style of a sequence. - - - - - Let the emitter choose the style. - - - - - The block sequence style. - - - - - The flow sequence style. - - - - - Represents a stream end event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - Represents a stream start event. - - - - - 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. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Invokes run-time type specific Visit() method of the specified visitor. - - visitor, may not be null. - - - - The exception that is thrown when an alias references an anchor - that has not yet been defined in a context that does not support forward references. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Supports implementations of by providing methods to combine two hash codes. - - - - - Combines two hash codes. - - The first hash code. - The second hash code. - - - - - Represents a YAML stream emitter. - - - - - Emits an event. - - - - - Gets a value indicating whether the end of the input reader has been reached. - - - - - Gets the character at the specified offset. - - - - - Skips the next characters. Those characters must have been - obtained first by calling the method. - - - - - Generic queue on which items may be inserted - - - - - Gets the number of items that are contained by the queue. - - - - - Enqueues the specified item. - - The item to be enqueued. - - - - Dequeues an item. - - Returns the item that been dequeued. - - - - Inserts an item at the specified index. - - The index where to insert the item. - The item to be inserted. - - - - Represents a YAML stream parser. - - - - - Gets the current event. Returns null before the first call to , - and also after returns false. - - - - - Moves to the next event. - - Returns true if there are more events available, otherwise returns false. - - - - Defines the interface for a stand-alone YAML scanner that - converts a sequence of characters into a sequence of YAML tokens. - - - - - Gets the current position inside the input stream. - - The current position. - - - - Gets the current token. - - - - - Moves to the next token and consumes the current token. - - - - - Moves to the next token without consuming the current token. - - - - - Consumes the current token. - - - - - Provides access to a stream and allows to peek at the next characters, - up to the buffer's capacity. - - - This class implements a circular buffer with a fixed capacity. - - - - - Initializes a new instance of the class. - - The input. - The capacity. - - - - Gets a value indicating whether the end of the input reader has been reached. - - - - - Gets the index of the character for the specified offset. - - - - - Gets the character at the specified offset. - - - - - Reads characters until at least characters are in the buffer. - - - Number of characters to cache. - - - - - Skips the next characters. Those characters must have been - obtained first by calling the or methods. - - - - - Represents a location inside a file - - - - - Gets a with empty values. - - - - - Gets / sets the absolute offset in the file - - - - - Gets / sets the number of the line - - - - - Gets / sets the index of the column - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - - - - - - - - - - - - - - - - Exception that is thrown when an infinite recursion is detected. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Simple implementation of that implements merging: http://yaml.org/type/merge.html - - - - - Parses YAML streams. - - - - - Initializes a new instance of the class. - - The input where the YAML stream is to be read. - - - - Initializes a new instance of the class. - - - - - Gets the current event. - - - - - Moves to the next event. - - Returns true if there are more events available, otherwise returns false. - - - - Parse the production: - stream ::= STREAM-START implicit_document? explicit_document* STREAM-END - ************ - - - - - Parse the productions: - implicit_document ::= block_node DOCUMENT-END* - * - explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* - ************************* - - - - - Parse directives. - - - - - Parse the productions: - explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* - *********** - - - - - Generate an empty scalar event. - - - - - Parse the productions: - block_node_or_indentless_sequence ::= - ALIAS - ***** - | properties (block_content | indentless_block_sequence)? - ********** * - | block_content | indentless_block_sequence - * - block_node ::= ALIAS - ***** - | properties block_content? - ********** * - | block_content - * - flow_node ::= ALIAS - ***** - | properties flow_content? - ********** * - | flow_content - * - properties ::= TAG ANCHOR? | ANCHOR TAG? - ************************* - block_content ::= block_collection | flow_collection | SCALAR - ****** - flow_content ::= flow_collection | SCALAR - ****** - - - - - Parse the productions: - implicit_document ::= block_node DOCUMENT-END* - ************* - explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* - ************* - - - - - Parse the productions: - block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END - ******************** *********** * ********* - - - - - Parse the productions: - indentless_sequence ::= (BLOCK-ENTRY block_node?)+ - *********** * - - - - - Parse the productions: - block_mapping ::= BLOCK-MAPPING_START - ******************* - ((KEY block_node_or_indentless_sequence?)? - *** * - (VALUE block_node_or_indentless_sequence?)?)* - - BLOCK-END - ********* - - - - - Parse the productions: - block_mapping ::= BLOCK-MAPPING_START - - ((KEY block_node_or_indentless_sequence?)? - - (VALUE block_node_or_indentless_sequence?)?)* - ***** * - BLOCK-END - - - - - - Parse the productions: - flow_sequence ::= FLOW-SEQUENCE-START - ******************* - (flow_sequence_entry FLOW-ENTRY)* - * ********** - flow_sequence_entry? - * - FLOW-SEQUENCE-END - ***************** - flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * - - - - - Parse the productions: - flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - *** * - - - - - Parse the productions: - flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - ***** * - - - - - Parse the productions: - flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * - - - - - Parse the productions: - flow_mapping ::= FLOW-MAPPING-START - ****************** - (flow_mapping_entry FLOW-ENTRY)* - * ********** - flow_mapping_entry? - ****************** - FLOW-MAPPING-END - **************** - flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * *** * - - - - - Parse the productions: - flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * ***** * - - - - - Extension methods that provide useful abstractions over . - - - - - Ensures that the current event is of the specified type, returns it and moves to the next event. - - Type of the . - Returns the current event. - If the current event is not of the specified type. - - - - Checks whether the current event is of the specified type. - If the event is of the specified type, returns it and moves to the next event. - Otherwise returns null. - - Type of the . - Returns true if the current event is of type T; otherwise returns null. - - - - Enforces that the current event is of the specified type. - - Type of the . - Returns the current event. - If the current event is not of the specified type. - - - - Checks whether the current event is of the specified type. - - Type of the event. - Returns true if the current event is of type . Otherwise returns false. - - - - Skips the current event and any nested event. - - - - - Attempts to find a key on a YAML mapping that matches our predicate. - This is useful for scanning a mapping for type discriminator information. - For example: looking for a `kind` key on an object. - - This function only checks mappings, and only looks at the current depth. - - If the event is a mapping and has a key that satisfies the predicate the scan - will stop, return true, and set and - . All events up until the predicate is matched will - be consumed. - - If the event is not a mapping event or a matching key is not found, returns false. - - The IParser which will have its current value checked for a matching mapping entry - The selector to filter the mapping by - The matching key of the mapping as a Scalar, or null if no matching key found - The matching value of the mapping as a ParsingEvent, or null if no matching key found - Returns true if the current event is a mapping entry with a key that matches the selector; - otherwise returns false. - - - - Keeps track of the recursion level, - and throws - whenever is reached. - - - - - Increments the recursion level, - and throws - if is reached. - - - - - Increments the recursion level, - and returns whether is still less than . - - - - - Decrements the recursion level. - - - - - Specifies the style of a YAML scalar. - - - - - Let the emitter choose the style. - - - - - The plain scalar style. - - - - - The single-quoted scalar style. - - - - - The double-quoted scalar style. - - - - - The literal scalar style. - - - - - The folded scalar style. - - - - - Converts a sequence of characters into a sequence of YAML tokens. - - - - - Gets the current token. - - - - - Initializes a new instance of the class. - - The input. - Indicates whether comments should be ignored - - - - Gets the current position inside the input stream. - - The current position. - - - - Moves to the next token. - - - - - - Consumes the current token and increments the parsed token count - - - - - Check the list of potential simple keys and remove the positions that - cannot contain simple keys anymore. - - - - - Pop indentation levels from the indents stack until the current level - becomes less or equal to the column. For each indentation level, append - the BLOCK-END token. - - - - - Produce the STREAM-END token and shut down the scanner. - - - - - Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token. - - Scope: - %YAML 1.1 # a comment \n - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - %TAG !yaml! tag:yaml.org,2002: \n - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - - - - Produce the DOCUMENT-START or DOCUMENT-END token. - - - - - Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token. - - - - - Increase the flow level and resize the simple key list if needed. - - - - - Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token. - - - - - Decrease the flow level. - - - - - Produce the FLOW-ENTRY token. - - - - - Produce the BLOCK-ENTRY token. - - - - - Produce the KEY token. - - - - - Produce the VALUE token. - - - - - Push the current indentation level to the stack and set the new level - the current column is greater than the indentation level. In this case, - append or insert the specified token into the token queue. - - - - - Produce the ALIAS or ANCHOR token. - - - - - Produce the TAG token. - - - - - Scan a TAG token. - - - - - Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens. - - - - - Scan a block scalar. - - - - - Scan indentation spaces and line breaks for a block scalar. Determine the - indentation level if needed. - - - - - Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens. - - - - - Scan a quoted scalar. - - - - - Produce the SCALAR(...,plain) token. - - - - - Scan a plain scalar. - - - - - Remove a potential simple key at the current flow level. - - - - - Scan the directive name. - - Scope: - %YAML 1.1 # a comment \n - ^^^^ - %TAG !yaml! tag:yaml.org,2002: \n - ^^^ - - - - - Scan the value of VERSION-DIRECTIVE. - - Scope: - %YAML 1.1 # a comment \n - ^^^^^^ - - - - - Scan the value of a TAG-DIRECTIVE token. - - Scope: - %TAG !yaml! tag:yaml.org,2002: \n - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - - - - Scan a tag. - - - - - Decode an URI-escape sequence corresponding to a single UTF-8 character. - - - - - Scan a tag handle. - - - - - Scan the version number of VERSION-DIRECTIVE. - - Scope: - %YAML 1.1 # a comment \n - ^ - %YAML 1.1 # a comment \n - ^ - - - - - Check if a simple key may start at the current position and add it if - needed. - - - - - Exception that is thrown when a semantic error is detected on a YAML stream. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Exception that is thrown when a syntax error is detected on a YAML stream. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Collection of . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - Initial content of the collection. - - - - - - - Gets a value indicating whether the collection contains a directive with the same handle - - - - - Represents an anchor token. - - - - - Gets the value. - - The value. - - - - Initializes a new instance of the class. - - The value. - - - - Initializes a new instance of the class. - - The value. - The start position of the token. - The end position of the token. - - - - Represents an alias token. - - - - - Gets the value of the alias. - - - - - Initializes a new instance of the class. - - The value of the anchor. - - - - Initializes a new instance of the class. - - The value of the anchor. - The start position of the event. - The end position of the event. - - - - Represents a block end token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a block entry event. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a block mapping start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a block sequence start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a comment - - - - - Gets the value of the comment - - - - - Gets a value indicating whether the comment appears other tokens on that line. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Represents a document end token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a document start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Error tokens. - - - - - Gets the value of the error - - - - - Represents a flow entry event. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a flow mapping end token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a flow mapping start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a flow sequence end token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a flow sequence start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a key token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a scalar token. - - - - - Gets or sets whether this scalar is a key - - - - - Gets the value. - - The value. - - - - Gets the style. - - The style. - - - - Initializes a new instance of the class. - - The value. - - - - Initializes a new instance of the class. - - The value. - The style. - - - - Initializes a new instance of the class. - - The value. - The style. - The start position of the token. - The end position of the token. - - - - Represents a stream end event. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a stream start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a tag token. - - - - - Gets the handle. - - The handle. - - - - Gets the suffix. - - The suffix. - - - - Initializes a new instance of the class. - - The handle. - The suffix. - - - - Initializes a new instance of the class. - - The handle. - The suffix. - The start position of the token. - The end position of the token. - - - - Represents a tag directive token. - - - - - Gets the handle. - - The handle. - - - - Gets the prefix. - - The prefix. - - - - Initializes a new instance of the class. - - The handle. - The prefix. - - - - Initializes a new instance of the class. - - The handle. - The prefix. - The start position of the token. - The end position of the token. - - - - Determines whether the specified System.Object is equal to the current System.Object. - - The System.Object to compare with the current System.Object. - - true if the specified System.Object is equal to the current System.Object; otherwise, false. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - - - - Base class for YAML tokens. - - - - - Gets the start of the token in the input stream. - - - - - Gets the end of the token in the input stream. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a value token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a version directive token. - - - - - Gets the version. - - The version. - - - - Initializes a new instance of the class. - - The version. - - - - Initializes a new instance of the class. - - The version. - The start position of the token. - The end position of the token. - - - - Determines whether the specified System.Object is equal to the current System.Object. - - The System.Object to compare with the current System.Object. - - true if the specified System.Object is equal to the current System.Object; otherwise, false. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Specifies the version of the YAML language. - - - - - Gets the major version number. - - - - - Gets the minor version number. - - - - - Initializes a new instance of the class. - - The major version number. - The minor version number. - - - - Determines whether the specified System.Object is equal to the current System.Object. - - The System.Object to compare with the current System.Object. - - true if the specified System.Object is equal to the current System.Object; otherwise, false. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Base exception that is thrown when the a problem occurs in the YamlDotNet library. - - - - - Gets the position in the input stream where the event that originated the exception starts. - - - - - Gets the position in the input stream where the event that originated the exception ends. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Generic implementation of object pooling pattern with predefined pool size limit. The main - purpose is that limited number of frequently used objects can be kept in the pool for - further recycling. - - Notes: - 1) it is not the goal to keep all returned objects. Pool is not meant for storage. If there - is no space in the pool, extra returned objects will be dropped. - - 2) it is implied that if object was obtained from a pool, the caller will return it back in - a relatively short time. Keeping checked out objects for long durations is ok, but - reduces usefulness of pooling. Just new up your own. - - Not returning objects to the pool in not detrimental to the pool's work, but is a bad practice. - Rationale: - If there is no intent for reusing the object, do not use pool - just use "new". - - - - - Not using System.Func{T} because this file is linked into the (debugger) Formatter, - which does not have that type (since it compiles against .NET 2.0). - - - - - Produces an instance. - - - Search strategy is a simple linear probing which is chosen for it cache-friendliness. - Note that Free will try to store recycled objects close to the start thus statistically - reducing how far we will typically search. - - - - - Returns objects to the pool. - - - Search strategy is a simple linear probing which is chosen for it cache-friendliness. - Note that Free will try to store recycled objects close to the start thus statistically - reducing how far we will typically search in Allocate. - - - - - Returns the that describes the property that - is being returned in an expression in the form: - - x => x.SomeProperty - - - - - - Adapts an to - because not all generic collections implement . - - - - - Adapts an to - because not all generic dictionaries implement . - - - - - Gets or sets the element with the specified index. - - The index of the element to get or set. - The element with the specified index. - - - - Adds an element with the provided key and value to the - at the given index. - - The zero-based index at which the item should be inserted. - The object to use as the key of the element to add. - The object to use as the value of the element to add. - - - - Removes the element at the specified index. - - The zero-based index of the element to remove. - - - - Pooling of StringBuilder instances. - - - - - Determines whether the specified type has a default constructor. - - The type. - Whether to include private constructors - - true if the type has a default constructor; otherwise, false. - - - - - Manages the state of a while it is loading. - - - - - Adds the specified node to the anchor list. - - The node. - - - - Gets the node with the specified anchor. - - The anchor. - The start position. - The end position. - - if there is no node with that anchor. - - - - Gets the node with the specified anchor. - - The anchor. - The node that was retrieved. - true if the anchor was found; otherwise false. - - - - Adds the specified node to the collection of nodes with unresolved aliases. - - - The that has unresolved aliases. - - - - - Resolves the aliases that could not be resolved while loading the document. - - - - - Holds state that is used when emitting a stream. - - - - - Gets the already emitted anchors. - - The emitted anchors. - - - - Defines the method needed to be able to visit Yaml elements. - - - - - Visits a . - - - The that is being visited. - - - - - Visits a . - - - The that is being visited. - - - - - Visits a . - - - The that is being visited. - - - - - Visits a . - - - The that is being visited. - - - - - Visits a . - - - The that is being visited. - - - - - Represents a LibYAML event stream. - - - - - Initializes a new instance of the class - from the specified . - - - - - Represents an alias node in the YAML document. - - - - - Initializes a new instance of the class. - - The anchor. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Recursively enumerates all the nodes from the document, starting on the current node, - and throwing - if is reached. - - - - - Gets the type of node. - - - - - Represents an YAML document. - - - - - Gets or sets the root node. - - The root node. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with a single scalar node. - - - - - Initializes a new instance of the class. - - - - - Visitor that assigns anchors to nodes that are referenced more than once. - Existing anchors are preserved as much as possible. - - - - - Key: Node, Value: IsDuplicate - - - - - Returns whether the visited node is a duplicate. - - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - Gets all nodes from the document. - is thrown if an infinite recursion is detected. - - - - - Represents a mapping node in the YAML document. - - - - - Gets the children of the current node. - - The children. - - - - Gets or sets the style of the node. - - The style. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - A sequence of where even elements are keys and odd elements are values. - - - - Initializes a new instance of the class. - - A sequence of where even elements are keys and odd elements are values. - - - - Adds the specified mapping to the collection. - - The key node. - The value node. - - - - Adds the specified mapping to the collection. - - The key node. - The value node. - - - - Adds the specified mapping to the collection. - - The key node. - The value node. - - - - Adds the specified mapping to the collection. - - The key node. - The value node. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Recursively enumerates all the nodes from the document, starting on the current node, - and throwing - if is reached. - - - - - Gets the type of node. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - - - - Creates a containing a key-value pair for each property of the specified object. - - - - - Represents a single node in the YAML document. - - - - - Gets or sets the anchor of the node. - - The anchor. - - - - Gets or sets the tag of the node. - - The tag. - - - - Gets the position in the input stream where the event that originated the node starts. - - - - - Gets the position in the input stream where the event that originated the node ends. - - - - - Loads the specified event. - - The event. - The state of the document. - - - - Parses the node represented by the next event in . - - Returns the node that has been parsed. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - Gets all nodes from the document, starting on the current node. - is thrown if an infinite recursion is detected. - - - - - When implemented, recursively enumerates all the nodes from the document, starting on the current node. - If is reached, a is thrown - instead of continuing and crashing with a . - - - - - Gets the type of node. - - - - - Performs an implicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an implicit conversion from string[] to . - - The value. - The result of the conversion. - - - - Converts a to a string by returning its value. - - - - - Gets the nth element in a . - - - - - Gets the value associated with a key in a . - - - - - Comparer that is based on identity comparisons. - - - - - - - - - - - Specifies the type of node in the representation model. - - - - - The node is a . - - - - - The node is a . - - - - - The node is a . - - - - - The node is a . - - - - - Represents a scalar node in the YAML document. - - - - - Gets or sets the value of the node. - - The value. - - - - Gets or sets the style of the node. - - The style. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The value. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Recursively enumerates all the nodes from the document, starting on the current node, - and throwing - if is reached. - - - - - Gets the type of node. - - - - - Represents a sequence node in the YAML document. - - - - - Gets the collection of child nodes. - - The children. - - - - Gets or sets the style of the node. - - The style. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Adds the specified child to the collection. - - The child. - - - - Adds a scalar node to the collection. - - The child. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Recursively enumerates all the nodes from the document, starting on the current node, - and throwing - if is reached. - - - - - Gets the type of node. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - - - - Represents an YAML stream. - - - - - Gets the documents inside the stream. - - The documents. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Adds the specified document to the collection. - - The document. - - - - Loads the stream from the specified input. - - The input. - - - - Loads the stream from the specified . - - - - - Saves the stream to the specified output. - - The output. - - - - Saves the stream to the specified output. - - The output. - Indicates whether or not to assign node anchors. - - - - Saves the stream to the specified emitter. - - The emitter. - Indicates whether or not to assign node anchors. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Abstract implementation of that knows how to walk a complete Yaml object model. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Abstract implementation of that knows how to walk a complete YAML object model. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called when this object is visiting a key-value pair. - - The left (key) that is being visited. - The right (value) that is being visited. - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Wraps a instance and allows it to be buffered as a LinkedList in memory and replayed. - - - - - Initializes a new instance of the class. - - The Parser to buffer. - The maximum depth of the parser to buffer before raising an ArgumentOutOfRangeException. - The maximum length of the LinkedList can buffer before raising an ArgumentOutOfRangeException. - If parser does not fit within the max depth and length specified. - - - - Gets the current event. Returns null after returns false. - - - - - Moves to the next event. - - Returns true if there are more events available, otherwise returns false. - - - - Resets the buffer back to it's first event. - - - - - The TypeDiscriminatingNodeDeserializer acts as a psuedo . - If any of it's has a matching BaseType, the TypeDiscriminatingNodeDeserializer will - begin buffering the yaml stream. It will then use the matching s to determine - a dotnet output type for the yaml node. As the node is buffered, the s are - able to examine the actual values within, and use these when discriminating a type. - Once a matching type is found, the TypeDiscriminatingNodeDeserializer uses it's inner deserializers to perform - the final deserialization for that type & object. - Usually you will want all default s that exist in the outer - to also be used as inner deserializers. - - - - - Adds an to be checked by the TypeDiscriminatingNodeDeserializer. - - The to add. - - - - Adds a to be checked by the TypeDiscriminatingNodeDeserializer. - s use the value of a specified key on the yaml object to map - to a target type. - - The yaml key to discriminate on. - A dictionary of values for the yaml key mapping to their respective types. - - - - Adds a to be checked by the TypeDiscriminatingNodeDeserializer. - s use the presence of unique keys on the yaml object to map - to different target types. - - A dictionary of unique yaml keys mapping to their respective types. - - - - An ITypeDiscriminator provides an interface for discriminating which dotnet type to deserialize a yaml - stream into. They require the yaml stream to be buffered as they - can inspect the yaml value, determine the desired type, and reset the yaml stream to then deserialize into - that type. - - - - - Gets the BaseType of the discriminator. All types that an ITypeDiscriminator may discriminate into must - inherit from this type. This enables the deserializer to only buffer values of matching types. - If you would like an ITypeDiscriminator to discriminate all yaml values, the BaseType will be object. - - - - - Trys to discriminate a type from the current IParser. As discriminating the type will consume the parser, the - parser will usually need to be a buffer so an instance of the discriminated type can be deserialized later. - - The IParser to consume and discriminate a type from. - The output type discriminated. Null if no type matched the discriminator. - Returns true if the discriminator matched the yaml stream. - - - - A TypeDiscriminator that discriminates which type to deserialize a yaml stream into by checking the value - of a known key. - - - - - Initializes a new instance of the class. - The KeyValueTypeDiscriminator will check the target key specified, and if it's value is contained within the - type mapping dictionary, the coresponding type will be discriminated. - - The base type which all discriminated types will implement. Use object if you're discriminating - unrelated types. Note the less specific you are with the base type the more yaml will need to be buffered. - The known key to check the value of when discriminating. - A mapping dictionary of yaml values to types. - If any of the target types do not implement the base type. - - - - Checks if the current parser contains the target key, and that it's value matches one of the type mappings. - If so, return true, and the matching type. - Otherwise, return false. - This will consume the parser, so you will usually need the parser to be a buffer so an instance - of the discriminated type can be deserialized later. - - The IParser to consume and discriminate a type from. - The output type discriminated. Null if there target key was not present of if the value - of the target key was not within the type mapping. - Returns true if the discriminator matched the yaml stream. - - - - A TypeDiscriminator that discriminates which type to deserialize a yaml stream into by checking the existence - of specific keys. - - - - - Initializes a new instance of the class. - The UniqueKeyTypeDiscriminator will check if any of the keys specified exist, and discriminate the coresponding type. - - The base type which all discriminated types will implement. Use object if you're discriminating - unrelated types. Note the less specific you are with the base type the more yaml will need to be buffered. - A mapping dictionary of yaml keys to types. - If any of the target types do not implement the base type. - - - - Checks if the current parser contains of the unique keys this discriminator has in it's type mapping. - If so, return true, and the matching type. - Otherwise, return false. - This will consume the parser, so you will usually need the parser to be a buffer so an instance - of the discriminated type can be deserialized later. - - The IParser to consume and discriminate a type from. - The output type discriminated. Null if there target key was not present of if the value - of the target key was not within the type mapping. - Returns true if the discriminator matched the yaml stream. - - - - Common implementation of and . - - - - - Prevents serialization and deserialization of fields. - - - - - - Allows serialization and deserialization of non-public properties. - - - - - Calling this will enable the support for private constructors when considering serialization and deserialization. - - - - - Sets the that will be used by the (de)serializer. - - - - - Sets the to use when handling enum's. - - Naming convention to use when handling enum's - - - - - Sets the that will be used by the (de)serializer. - - - - - Register an for a given property. - - - An expression in the form: x => x.SomeProperty - The attribute to register. - - - - - Register an for a given property. - - - - - Registers an additional to be used by the (de)serializer. - - - - - Registers an additional to be used by the (de)serializer. - - - Configures the location where to insert the - - - - Registers an additional to be used by the (de)serializer. - - A factory that creates the based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers an additional to be used by the (de)serializer. - - A function that instantiates the type inspector. - - - - Registers an additional to be used by the (de)serializer. - - A function that instantiates the type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the (de)serializer. - - A function that instantiates the type inspector based on a previously registered .. - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Override the default yaml formatter with the one passed in - - to use when serializing and deserializing objects. - - - - - - A factory that creates instances of based on an existing . - - The type of the wrapped component. - The type of the component that this factory creates. - The component that is to be wrapped. - Returns a new instance of that is based on . - - - - A factory that creates instances of based on an existing and an argument. - - The type of the argument. - The type of the wrapped component. - The type of the component that this factory creates. - The component that is to be wrapped. - The argument of the factory. - Returns a new instance of that is based on and . - - - - This represents the YAML converter entity for using the ISO-8601 standard format. - - - - - Initializes a new instance of the class using the default any scalar style. - - - - - Initializes a new instance of the class. - - - - - Gets a value indicating whether the current converter supports converting the specified type. - - to check. - Returns True, if the current converter supports; otherwise returns False. - - - - Reads an object's state from a YAML parser. - - instance. - to convert. - The deserializer to use to deserialize complex types. - Returns the instance converted. - On deserializing, all formats in the list are used for conversion. - - - - Writes the specified object's state to a YAML emitter. - - instance. - Value to write. - to convert. - A serializer to serializer complext objects. - On serializing, the first format in the list is used. - - - - This represents the YAML converter entity for . - - - - - Initializes a new instance of the class. - - value. Default value is . is considered as . - instance. Default value is . - If true, will use double quotes when writing the value to the stream. - List of date/time formats for parsing. Default value is "G". - On deserializing, all formats in the list are used for conversion, while on serializing, the first format in the list is used. - - - - Gets a value indicating whether the current converter supports converting the specified type. - - to check. - Returns True, if the current converter supports; otherwise returns False. - - - - Reads an object's state from a YAML parser. - - instance. - to convert. - The deserializer to use to deserialize complex types. - Returns the instance converted. - On deserializing, all formats in the list are used for conversion. - - - - Writes the specified object's state to a YAML emitter. - - instance. - Value to write. - to convert. - A serializer to serializer complext objects. - On serializing, the first format in the list is used. - - - - Converts the object to a string representation - To use this converter, call WithTypeConverter(new DateTimeOffsetConverter()) on the - or . - - - - - Initializes a new instance of the class. - - instance. Default value is . - If true, will use double quotes when writing the value to the stream. - - List of date/time formats for parsing. Default value is "O". - On deserializing, all formats in the list are used for conversion, while on serializing, the first format in the list is used. - - - - Gets a value indicating whether the current converter supports converting the specified type. - - to check. - Returns True, if the current converter supports; otherwise returns False. - - - - Reads an object's state from a YAML parser. - - instance. - to convert. - The deserializer to use to deserialize complex types. - Returns the instance converted. - On deserializing, all formats in the list are used for conversion. - - - - Writes the specified object's state to a YAML emitter. - - instance. - Value to write. - to convert. - A serializer to serializer complext objects. - On serializing, the first format in the list is used. - - - - Converter for System.Guid. - - - - - Converter for System.Type. - - - Converts to a scalar containing the assembly qualified name of the type. - - - - - Specifies the strategy to handle default and null values during serialization of properties. - - - - - Specifies that all properties are to be emitted regardless of their value. This is the default behavior. - - - - - Specifies that properties that contain null references or a null Nullable<T> are to be omitted. - - - - - Specifies that properties that that contain their default value, either default(T) or the value specified in DefaultValueAttribute are to be omitted. - - - - - Specifies that properties that that contain collections/arrays/enumerations that are empty are to be omitted. - - - - - Deserializes objects from the YAML format. - To customize the behavior of , - use the class. - - - - - Initializes a new instance of using the default configuration. - - - To customize the behavior of the deserializer, use . - - - - - This constructor is private to discourage its use. - To invoke it, call the method. - - - - - Creates a new that uses the specified . - This method is available for advanced scenarios. The preferred way to customize the behavior of the - deserializer is to use . - - - - - Deserializes an object of the specified type. - - The from where to deserialize the object. - The static type of the object to deserialize. - Returns the deserialized object. - - - - Creates and configures instances of . - This class is used to customize the behavior of . Use the relevant methods - to apply customizations, then call to create an instance of the deserializer - with the desired customizations. - - - - - Initializes a new using the default component registrations. - - - - - Builds the type inspector used by various classes to get information about types and their members. - - - - - - When deserializing it will attempt to convert unquoted strings to their correct datatype. If conversion is not sucessful, it will leave it as a string. - This option is only applicable when not specifying a type or specifying the object type during deserialization. - - - - - Sets the that will be used by the deserializer. - - - - - Sets the that will be used by the deserializer. - - - - - Registers an additional to be used by the deserializer. - - - - - Registers an additional to be used by the deserializer. - - - Configures the location where to insert the - - - - Registers an additional to be used by the deserializer. - - A factory that creates the based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers a to be used by the deserializer. This internally registers - all existing as inner deserializers available to the . - Usually you will want to call this after any other changes to the s used by the deserializer. - - An action that can configure the . - Configures the max depth of yaml nodes that will be buffered. A value of -1 (the default) means yaml nodes of any depth will be buffered. - Configures the max number of yaml nodes that will be buffered. A value of -1 (the default) means there is no limit on the number of yaml nodes buffered. - - - - Registers an additional to be used by the deserializer. - - - - - Registers an additional to be used by the deserializer. - - - Configures the location where to insert the - - - - Registers an additional to be used by the deserializer. - - A factory that creates the based on a previously registered . - Configures the location where to insert the - - - - Ignore case when matching property names. - - - - - - Enforce whether null values can be set on non-nullable properties and fields. - - This deserializer builder. - - - - Require that all members with the 'required' keyword be set by YAML. - - - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers a tag mapping. - - - - - Registers a type mapping using the default object factory. - - - - - Unregisters an existing tag mapping. - - - - - Instructs the deserializer to ignore unmatched properties instead of throwing an exception. - - - - - Instructs the deserializer to check for duplicate keys and throw an exception if duplicate keys are found. - - - - - - Creates a new according to the current configuration. - - - - - Creates a new that implements the current configuration. - This method is available for advanced scenarios. The preferred way to customize the behavior of the - deserializer is to use the method. - - - - - Gets the next visitor that should be called by the current visitor. - - - - - Gets the that is to be used for serialization. - - - - - Gets a function that, when called, serializes the specified object. - - - - - Gets the visitor of type that was used during the pre-processing phase. - - The type of the visitor.s - - - No visitor of that type has been registered, - or ore than one visitors registered are of type . - - - - - Provided the base implementation for an IEventEmitter that is a - decorator for another IEventEmitter. - - - - - This pattern matches strings that are special both in YAML 1.1 and 1.2 - - - - - Deserializes an object of the specified type. - - The from where to deserialize the object. - The static type of the object to deserialize. - Returns the deserialized object. - - - - Translates property names according to a specific convention. - - - - - Determines the type of the specified node. - - The node to be deserialized. - The type that has been determined so far. - - true if has been resolved completely; - false if the next type should be invoked. - - - - - The interface to implement for getting/setting an objects fields and properties when using a static context - - - - - Set a field/property value - - Name of the field or property. - Object to set the field/property on. - Value to set the field/property to. - - - - Reads a value from a field/property - - Name of the field or property. - Object to get the field/property from. - - - - - Represents an object along with its type. - - - - - A reference to the object. - - - - - The type that should be used when to interpret the . - - - - - The type of as determined by its container (e.g. a property). - - - - - The style to be used for scalars. - - - - - Returns the Value property of the if it is not null. - This is useful in all places that the value must not be null. - - An object descriptor. - Thrown when the Value is null - - - - - Creates instances of types. - - - This interface allows to provide a custom logic for creating instances during deserialization. - - - - - Creates an instance of the specified type. - - - - - Creates a default value for the .net primitive types (string, int, bool, etc) - - - - - - - If the type is convertable to a non generic dictionary, then it will do so and set dictionary and genericArguments to the correct values and return true. - If not, values will be null and the result will be false.. - - Object descriptor to try and convert - The converted dictionary - Generic type arguments that specify the key and value type - True if converted, false if not - - - - Gets the type of the value part of a dictionary or list. - - - - - - - Executes the methods on the object that has the attribute - - - - - - Executes the methods on the object that has the attribute - - - - - - Executes the methods on the object that has the attribute - - - - - - Executes the methods on the object that has the attribute - - - - - - Defines a strategy that walks through an object graph. - - - - - Traverses the specified object graph. - - The graph. - An that is to be notified during the traversal. - A that will be passed to the . - The serializer to use to serialize complex objects. - - - - Defined the interface of a type that can be notified during an object graph traversal. - - - - - Indicates whether the specified value should be entered. This allows the visitor to - override the handling of a particular object or type. - - The value that is about to be entered. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - The descriptor for the property that the value belongs to. - If the value is to be entered, returns true; otherwise returns false; - - - - Indicates whether the specified mapping should be entered. This allows the visitor to - override the handling of a particular pair. - - The key of the mapping that is about to be entered. - The value of the mapping that is about to be entered. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - If the mapping is to be entered, returns true; otherwise returns false; - - - - Indicates whether the specified mapping should be entered. This allows the visitor to - override the handling of a particular pair. This overload should be invoked when the - mapping is produced by an object's property. - - The that provided access to . - The value of the mapping that is about to be entered. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - If the mapping is to be entered, returns true; otherwise returns false; - - - - Notifies the visitor that a scalar value has been encountered. - - The value of the scalar. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - - - - Notifies the visitor that the traversal of a mapping is about to begin. - - The value that corresponds to the mapping. - The static type of the keys of the mapping. - The static type of the values of the mapping. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - - - - Notifies the visitor that the traversal of a mapping has ended. - - The value that corresponds to the mapping. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - - - - Notifies the visitor that the traversal of a sequence is about to begin. - - The value that corresponds to the sequence. - The static type of the elements of the sequence. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - - - - Notifies the visitor that the traversal of a sequence has ended. - - The value that corresponds to the sequence. - The context that this implementation depend on. - A serializer that can be used to serialize complex objects. - - - - Registers the component in place of the already registered component of type . - - - - - Registers the component before the already registered component of type . - - - - - Registers the component after the already registered component of type . - - - - - Registers the component before every other previously registered component. - - - - - Registers the component after every other previously registered component. - - - - - Registers the component in place of the already registered component of type . - - - - - Serializes the specified object into a string. - - The object to serialize. - - - - Serializes the specified object into a string. - - The object to serialize. - The static type of the object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - The static type of the object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - The static type of the object to serialize. - - - - Provides access to the properties of a type. - - - - - Gets all properties of the specified type. - - The type whose properties are to be enumerated. - The actual object of type whose properties are to be enumerated. Can be null. - - - - - Gets the property of the type with the specified name. - - The type whose properties are to be searched. - The actual object of type whose properties are to be searched. Can be null. - The name of the property. - - Determines if an exception or null should be returned if can't be - found in - - If true use case-insitivity when choosing the property or field. - - - - - Returns the actual name from the EnumMember attribute - - The type of the enum. - The name to lookup. - The actual name of the enum value. - - - - Return the value of the enum - - - - - - - Resolves the type of values. - - - - - Allows an object to customize how it is serialized and deserialized. - - - - - Reads this object's state from a YAML parser. - - The parser where the object's state should be read from. - The type that the deserializer is expecting. - - A function that will use the current deserializer - to read an object of the given type from the parser. - - - - - Writes this object's state to a YAML emitter. - - The emitter where the object's state should be written to. - A function that will use the current serializer to write an object to the emitter. - - - - Represents a function that is used to deserialize an object of the given type. - - The type that the deserializer should read. - Returns the object that was deserialized. - - - - Represents a function that is used to serialize an object of the given type. - - The object to be serialized. - - The type that should be considered when emitting the object. - If null, the actual type of the is used. - - - - - Allows an object to customize how it is serialized and deserialized. - - - - - Reads this object's state from a YAML parser. - - - - - Writes this object's state to a YAML emitter. - - - - - Allows to customize how a type is serialized and deserialized. - - - - - Gets a value indicating whether the current converter supports converting the specified type. - - - - - Reads an object's state from a YAML parser. - - - - - Writes the specified object's state to a YAML emitter. - - - - - Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to - camel case (thisIsATest). Camel case is the same as Pascal case, except the first letter - is lowercase. - - - - - Convert the string from camelcase (thisIsATest) to a hyphenated (this-is-a-test) string - - - - - Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to - lower case (thisisatest). - - - - - Performs no naming conversion. - - - - - Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to - pascal case (ThisIsATest). Pascal case is the same as camel case, except the first letter - is uppercase. - - - - - Convert the string from camelcase (thisIsATest) to a underscored (this_is_a_test) string - - - - - An empty type for cases where a type needs to be provided but won't be used. - - - - - Creates objects using Activator.CreateInstance. - - - - - Creates objects using a Func{Type,object}"/>. - - - - - - - - - - - - - - - - - Gets information about and creates statically known, serializable, types. - - - - - Create an object of the specified type - - Type of object to create - - - - - Creates an array of the specified type with the size specified - - The type of the array, should be the whole type, not just the value type - How large the array should be - - - - - Gets whether the type is a dictionary or not - - Type to check - - - - - Gets whether the type is an array or not - - Type to check - - - - - Gets whether the type is a list - - Type to check - - - - - Gets the type of the key of a dictionary - - - - - - - Gets the type of the value part of a dictionary or list. - - - - - - - Creates the default value of primitive types - - - - - - - The static implementation of yamldotnet doesn't support generating types, so we will return null's and false since we can't do anything. - - - - - - - - - An implementation of that traverses - readable properties, collections and dictionaries. - - - - - An implementation of that traverses - properties that are read/write, collections and dictionaries, while ensuring that - the graph can be regenerated from the resulting document. - - - - - A factory method for creating instances - - The type inspector to be used by the traversal strategy. - The type resolver to be used by the traversal strategy. - The type converters to be used by the traversal strategy. - The maximum object depth to be supported by the traversal strategy. - - - - - A base class that simplifies the correct implementation of . - - - - - Initializes a new instance of using the default configuration. - - - To customize the behavior of the serializer, use . - - - - - This constructor is private to discourage its use. - To invoke it, call the method. - - - - - Creates a new that uses the specified . - This method is available for advanced scenarios. The preferred way to customize the behavior of the - deserializer is to use . - - - - - Serializes the specified object into a string. - - The object to serialize. - - - - Serializes the specified object into a string. - - The object to serialize. - The static type of the object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - The static type of the object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - The static type of the object to serialize. - - - - Creates and configures instances of . - This class is used to customize the behavior of . Use the relevant methods - to apply customizations, then call to create an instance of the serializer - with the desired customizations. - - - - - Put double quotes around strings that need it, for example Null, True, False, a number. This should be called before any other "With" methods if you want this feature enabled. - - Also quote strings that are valid scalars in the YAML 1.1 specification (which includes boolean Yes/No/On/Off, base 60 numbers and more) - - - - Sets the default quoting style for scalar values. The default value is - - - - - Sets the maximum recursion that is allowed while traversing the object graph. The default value is 50. - - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers a tag mapping. - - - - - Unregisters an existing tag mapping. - - - - - Ensures that it will be possible to deserialize the serialized objects. - This option will force the emission of tags and emit only properties with setters. - - - - - Specifies that, if the same object appears more than once in the - serialization graph, it will be serialized each time instead of just once. - - - If the serialization graph contains circular references and this flag is set, - a StackOverflowException will be thrown. - If this flag is not set, there is a performance penalty because the entire - object graph must be walked twice. - - - - - Forces every value to be serialized, even if it is the default value for that type. - - - - - Configures how properties with default and null values should be handled. The default value is DefaultValuesHandling.Preserve - - - If more control is needed, create a class that extends from ChainedObjectGraphVisitor and override its EnterMapping methods. - Then register it as follows: - WithEmissionPhaseObjectGraphVisitor(args => new MyDefaultHandlingStrategy(args.InnerVisitor)); - - - - - Ensures that the result of the serialization is valid JSON. - - - - - Allows you to override the new line character to use when serializing to YAML. - - NewLine character(s) to use when serializing to YAML. - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - The type inspector. - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector. - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - The type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector based on a previously registered . - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers an to be used by the serializer - while traversing the object graph. - - A function that instantiates the traversal strategy. - - - - Registers an additional to be used by the serializer - while emitting an object graph. - - A function that instantiates the type inspector. - - - - Registers an additional to be used by the serializer - while emitting an object graph. - - A function that instantiates the type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - while emitting an object graph. - - A function that instantiates the type inspector based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Creates sequences with extra indentation - - - list: - - item - - item - - - - - - Creates a new according to the current configuration. - - - - - Creates a new that implements the current configuration. - This method is available for advanced scenarios. The preferred way to customize the behavior of the - deserializer is to use the method. - - - - - Builds the type inspector used by various classes to get information about types and their members. - - - - - - If true then private, parameterless constructors will be invoked if a public one is not available. - - - - - Common implementation of and . - - - - - Sets the that will be used by the (de)serializer. - - - - - Sets the to use when handling enum's. - - Naming convention to use when handling enum's - - - - - Sets the that will be used by the (de)serializer. - - - - - Registers an additional to be used by the (de)serializer. - - - - - Registers an additional to be used by the (de)serializer. - - - Configures the location where to insert the - - - - Registers an additional to be used by the (de)serializer. - - A factory that creates the based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers an additional to be used by the (de)serializer. - - A function that instantiates the type inspector. - - - - Registers an additional to be used by the (de)serializer. - - A function that instantiates the type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the (de)serializer. - - A function that instantiates the type inspector based on a previously registered .. - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Override the default yaml formatter with the one passed in - - to use when serializing and deserializing objects. - - - - - - Holds the static object factory and type inspector to use when statically serializing/deserializing YAML. - - - - - Gets whether the type is known to the context - - Type to check - - - - - Gets the to use for serialization - - - - - - Gets the factory to use for serialization and deserialization - - - - - - Gets the type inspector to use when statically serializing/deserializing YAML. - - - - - - Creates and configures instances of . - This class is used to customize the behavior of . Use the relevant methods - to apply customizations, then call to create an instance of the deserializer - with the desired customizations. - - - - - Initializes a new using the default component registrations. - - - - - Builds the type inspector used by various classes to get information about types and their members. - - - - - - When deserializing it will attempt to convert unquoted strings to their correct datatype. If conversion is not sucessful, it will leave it as a string. - This option is only applicable when not specifying a type or specifying the object type during deserialization. - - - - - Registers an additional to be used by the deserializer. - - - - - Registers an additional to be used by the deserializer. - - - Configures the location where to insert the - - - - Registers an additional to be used by the deserializer. - - A factory that creates the based on a previously registered . - Configures the location where to insert the - - - - Ignore case when matching property names. - - - - - - Enforce whether null values can be set on non-nullable properties and fields. - - This static deserializer builder. - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers a to be used by the deserializer. This internally registers - all existing as inner deserializers available to the . - Usually you will want to call this after any other changes to the s used by the deserializer. - - An action that can configure the . - Configures the max depth of yaml nodes that will be buffered. A value of -1 (the default) means yaml nodes of any depth will be buffered. - Configures the max number of yaml nodes that will be buffered. A value of -1 (the default) means there is no limit on the number of yaml nodes buffered. - - - - Registers an additional to be used by the deserializer. - - - - - Registers an additional to be used by the deserializer. - - - Configures the location where to insert the - - - - Registers an additional to be used by the deserializer. - - A factory that creates the based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers a tag mapping. - - - - - Registers a type mapping using the default object factory. - - - - - Unregisters an existing tag mapping. - - - - - Instructs the deserializer to ignore unmatched properties instead of throwing an exception. - - - - - Instructs the deserializer to check for duplicate keys and throw an exception if duplicate keys are found. - - - - - - Creates a new according to the current configuration. - - - - - Creates a new that implements the current configuration. - This method is available for advanced scenarios. The preferred way to customize the behavior of the - deserializer is to use the method. - - - - - Creates and configures instances of . - This class is used to customize the behavior of . Use the relevant methods - to apply customizations, then call to create an instance of the serializer - with the desired customizations. - - - - - Put double quotes around strings that need it, for example Null, True, False, a number. This should be called before any other "With" methods if you want this feature enabled. - - Also quote strings that are valid scalars in the YAML 1.1 specification (which includes boolean Yes/No/On/Off, base 60 numbers and more) - - - - Put double quotes around strings that need it, for example Null, True, False, a number. This should be called before any other "With" methods if you want this feature enabled. - - - - - Sets the default quoting style for scalar values. The default value is - - - - - Sets the maximum recursion that is allowed while traversing the object graph. The default value is 50. - - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer. - - A function that instantiates the event emitter based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers a tag mapping. - - - - - Unregisters an existing tag mapping. - - - - - Ensures that it will be possible to deserialize the serialized objects. - This option will force the emission of tags and emit only properties with setters. - - - - - Specifies that, if the same object appears more than once in the - serialization graph, it will be serialized each time instead of just once. - - - If the serialization graph contains circular references and this flag is set, - a StackOverflowException will be thrown. - If this flag is not set, there is a performance penalty because the entire - object graph must be walked twice. - - - - - Forces every value to be serialized, even if it is the default value for that type. - - - - - Configures how properties with default and null values should be handled. The default value is DefaultValuesHandling.Preserve - - - If more control is needed, create a class that extends from ChainedObjectGraphVisitor and override its EnterMapping methods. - Then register it as follows: - WithEmissionPhaseObjectGraphVisitor(args => new MyDefaultHandlingStrategy(args.InnerVisitor)); - - - - - Ensures that the result of the serialization is valid JSON. - - - - - Allows you to override the new line character to use when serializing to YAML. - - NewLine character(s) to use when serializing to YAML. - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - The type inspector. - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector. - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - The type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector based on a previously registered . - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - before emitting an object graph. - - - Registering a visitor in the pre-processing phase enables to traverse the object graph once - before actually emitting it. This allows a visitor to collect information about the graph that - can be used later by another visitor registered in the emission phase. - - A function that instantiates the type inspector based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Registers an to be used by the serializer - while traversing the object graph. - - A function that instantiates the traversal strategy. - - - - Registers an additional to be used by the serializer - while emitting an object graph. - - A function that instantiates the type inspector. - - - - Registers an additional to be used by the serializer - while emitting an object graph. - - A function that instantiates the type inspector. - Configures the location where to insert the - - - - Registers an additional to be used by the serializer - while emitting an object graph. - - A function that instantiates the type inspector based on a previously registered . - Configures the location where to insert the - - - - Unregisters an existing of type . - - - - - Unregisters an existing of type . - - - - - Creates sequences with extra indentation - - - list: - - item - - item - - - - - - Creates a new according to the current configuration. - - - - - Creates a new that implements the current configuration. - This method is available for advanced scenarios. The preferred way to customize the behavior of the - deserializer is to use the method. - - - - - Builds the type inspector used by various classes to get information about types and their members. - - - - - - An object that contains part of a YAML stream. - - - - - Gets or sets the events. - - The events. - - - - Reads this object's state from a YAML parser. - - - - - Writes this object's state to a YAML emitter. - - - - - Contains mappings between tags and types. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The mappings. - - - - Adds the specified tag. - - The tag. - The mapping. - - - - Gets the mapping. - - The tag. - - - - - Wraps another and applies caching. - - - - - Aggregates the results from multiple into a single one. - - - - - Wraps another and applies a - naming convention to the names of the properties. - - - - - Returns the properties of a type that are both readable and writable. - - - - - Returns the properties and fields of a type that are readable. - - - - - Returns the properties of a type that are readable. - - - - - Returns the properties of a type that are writable. - - - - - The type returned will be the actual type of the value, if available. - - - - - Except for primitive types, the type returned will always be the static type. - - - - - Indicates that a class used as deserialization state - needs to be notified after deserialization. - - - - - Convert a value to a specified type - - - - Naming convention to use on enums in the type converter. - The type inspector to use when getting information about a type. - - - - - Adds the specified anchor. - - The anchor. - The @object. - - - - Gets the anchor for the specified object. - - The object. - The anchor. - - - - - Gets the with the specified anchor. - - - - - - A generic container that is preserved during the entire deserialization process. - Any disposable object added to this collection will be disposed when this object is disposed. - - - - - Invokes on all - objects added to this collection that implement . - - - - - Various string extension methods - - - - - Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to - camel case (thisIsATest). Camel case is the same as Pascal case, except the first letter - is lowercase. - - String to convert - Converted string - - - - Convert the string with underscores (this_is_a_test) or hyphens (this-is-a-test) to - pascal case (ThisIsATest). Pascal case is the same as camel case, except the first letter - is uppercase. - - String to convert - Converted string - - - - Convert the string from camelcase (thisIsATest) to a hyphenated (this-is-a-test) or - underscored (this_is_a_test) string - - String to convert - Separator to use between segments - Converted string - - - - Performs type conversions using every standard provided by the .NET library. - - - - - Converts the specified value. - - The type to which the value is to be converted. - The value to convert. - Naming convention to apply to enums. - The type inspector to use when getting information about a type. - - - - - Converts the specified value using the invariant culture. - - The value to convert. - The type to which the value is to be converted. - Naming convention to apply to enums. - The type inspector to use when getting information about a type. - - - - - Converts the specified value. - - The value to convert. - The type to which the value is to be converted. - The format provider. - Naming convention to apply to enums. - The type inspector to use when getting information about a type. - - - - - Converts the specified value. - - The value to convert. - The type to which the value is to be converted. - The culture. - Naming convention to apply to enums. - The type inspector to use when getting information about a type. - - - - - Registers a dynamically. - - The type to which the converter should be associated. - The type of the converter. - - - - Define a collection of YamlAttribute Overrides for pre-defined object types. - - - - - Checks whether this mapping matches the specified type, and returns a value indicating the match priority. - - The priority of the match. Higher values have more priority. Zero indicates no match. - - - - Adds a Member Attribute Override - - Type - Class Member - Overriding Attribute - - - - Creates a copy of this instance. - - - - - Adds a Member Attribute Override - - - - - Applies the Yaml attribute overrides to another . - - - - - Applies the Yaml* attributes to another . - - - - - Converts an enum to it's string representation. - By default it will be the string representation of the enum passed through the naming convention. - - A string representation of the enum - - - - If this function returns true, the serializer will put quotes around the formatted enum value if necessary. Defaults to true. - - - - - Instructs the YamlSerializer not to serialize the public field or public read/write property value. - - - - - Provides special Yaml serialization instructions. - - - - - Decription/Comment about this property. - When set, a comment will be emitted when serializing this member. - - - - - Specifies that this property should be serialized as the given type, rather than using the actual runtime value's type. - - - - - Specifies the order priority of this property. - - - - - Instructs the to use a different field name for serialization. - - - - - When false, naming conventions will not be applied to this member. Defaults to true. - - - - - Specifies the scalar style of the property when serialized. This will only affect the serialization of scalar properties. - - - - - Overrides how null and default values should be handled for this property. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - Specifies that this property should be serialized as the given type, rather than using the actual runtime value's type. - - - - Put this attribute either on serializable types or on the that you want - the static analyzer to detect and use. - - - - - Use this constructor if the attribute is placed on a serializable class. - - - - - Use this constructor if the attribute is placed on the . - - The type for which to include static code generation. - - - diff --git a/powershell-yaml.psm1 b/powershell-yaml.psm1 index 9e39a46..684548f 100644 --- a/powershell-yaml.psm1 +++ b/powershell-yaml.psm1 @@ -27,15 +27,15 @@ enum SerializationOptions { UseSequenceFlowStyle = 256 } $here = Split-Path -Parent $MyInvocation.MyCommand.Path -$infinityRegex = [regex]::new('^[-+]?(\.inf|\.Inf|\.INF)$', "Compiled, CultureInvariant"); +$infinityRegex = [regex]::new('^[-+]?(\.inf|\.Inf|\.INF)$', 'Compiled, CultureInvariant'); function Invoke-LoadFile { param( [string]$assemblyPath ) - $powershellYamlDotNetAssemblyPath = Join-Path $assemblyPath "YamlDotNet.dll" - $serializerAssemblyPath = Join-Path $assemblyPath "PowerShellYamlSerializer.dll" + $powershellYamlDotNetAssemblyPath = Join-Path $assemblyPath 'YamlDotNet.dll' + $serializerAssemblyPath = Join-Path $assemblyPath 'PowerShellYamlSerializer.dll' $yamlAssembly = [Reflection.Assembly]::LoadFile($powershellYamlDotNetAssemblyPath) $serializerAssembly = [Reflection.Assembly]::LoadFile($serializerAssemblyPath) @@ -53,7 +53,7 @@ function Invoke-LoadFile { # Load YamlDotNet if it's requested by PowerShellYamlSerializer. Ignore other requests as they might # originate from other assemblies that are not part of this module and which might have different # versions of the module that they need to load. - if ($e.Name -match "^YamlDotNet,*" -and $e.RequestingAssembly.Location -eq $serializerAssemblyPath) { + if ($e.Name -match '^YamlDotNet,*' -and $e.RequestingAssembly.Location -eq $serializerAssemblyPath) { return [System.Reflection.Assembly]::LoadFile($powershellYamlDotNetAssemblyPath) } @@ -62,54 +62,46 @@ function Invoke-LoadFile { [System.AppDomain]::CurrentDomain.add_AssemblyResolve($resolver) # Load the StringQuotingEmitter from PowerShellYamlSerializer to force the resolver handler to fire once. # This is an ugly hack I am not happy with. - $serializerAssembly.GetType("StringQuotingEmitter") | Out-Null + $serializerAssembly.GetType('StringQuotingEmitter') | Out-Null # Remove the resolver handler after it has been used. [System.AppDomain]::CurrentDomain.remove_AssemblyResolve($resolver) } - return @{ "yaml"= $yamlAssembly; "quoted" = $serializerAssembly } + return @{ 'yaml' = $yamlAssembly; 'quoted' = $serializerAssembly } } function Invoke-LoadAssembly { - $libDir = Join-Path $here "lib" + $libDir = Join-Path $here 'lib' $assemblies = @{ - "core" = Join-Path $libDir "netstandard2.1"; - "net47" = Join-Path $libDir "net47"; + 'netstandard2.0' = Join-Path $libDir 'netstandard2.0'; } - if ($PSVersionTable.Keys -contains "PSEdition") { - if ($PSVersionTable.PSEdition -eq "Core") { - return (Invoke-LoadFile -assemblyPath $assemblies["core"]) - } - return (Invoke-LoadFile -assemblyPath $assemblies["net47"]) - } else { - return (Invoke-LoadFile -assemblyPath $assemblies["net47"]) - } + return (Invoke-LoadFile -assemblyPath $assemblies['netstandard2.0']) } $assemblies = Invoke-LoadAssembly -$yamlDotNetAssembly = $assemblies["yaml"] -$stringQuotedAssembly = $assemblies["quoted"] +$yamlDotNetAssembly = $assemblies['yaml'] +$stringQuotedAssembly = $assemblies['quoted'] function Get-YamlDocuments { [CmdletBinding()] - Param( - [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + param( + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [string]$Yaml, - [switch]$UseMergingParser=$false + [switch]$UseMergingParser = $false ) - PROCESS { - $stringReader = new-object System.IO.StringReader($Yaml) - $parserType = $yamlDotNetAssembly.GetType("YamlDotNet.Core.Parser") + process { + $stringReader = New-Object System.IO.StringReader($Yaml) + $parserType = $yamlDotNetAssembly.GetType('YamlDotNet.Core.Parser') $parser = $parserType::new($stringReader) - if($UseMergingParser) { - $parserType = $yamlDotNetAssembly.GetType("YamlDotNet.Core.MergingParser") + if ($UseMergingParser) { + $parserType = $yamlDotNetAssembly.GetType('YamlDotNet.Core.MergingParser') $parser = $parserType::new($parser) } - $yamlStream = $yamlDotNetAssembly.GetType("YamlDotNet.RepresentationModel.YamlStream")::new() + $yamlStream = $yamlDotNetAssembly.GetType('YamlDotNet.RepresentationModel.YamlStream')::new() $yamlStream.Load($parser) $stringReader.Close() @@ -120,65 +112,65 @@ function Get-YamlDocuments { function Convert-ValueToProperType { [CmdletBinding()] - Param( - [Parameter(Mandatory=$true,ValueFromPipeline=$true)] + param( + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [System.Object]$Node ) - PROCESS { + process { if (!($Node.Value -is [string])) { return $Node } $intTypes = @([int], [long]) if ([string]::IsNullOrEmpty($Node.Tag) -eq $false) { - switch($Node.Tag) { - "tag:yaml.org,2002:str" { + switch ($Node.Tag) { + 'tag:yaml.org,2002:str' { return $Node.Value } - "tag:yaml.org,2002:null" { + 'tag:yaml.org,2002:null' { return $null } - "tag:yaml.org,2002:bool" { + 'tag:yaml.org,2002:bool' { $parsedValue = $false if (![boolean]::TryParse($Node.Value, [ref]$parsedValue)) { - Throw ("failed to parse scalar {0} as boolean" -f $Node) + throw ('failed to parse scalar {0} as boolean' -f $Node) } return $parsedValue } - "tag:yaml.org,2002:int" { + 'tag:yaml.org,2002:int' { $parsedValue = 0 if ($node.Value.Length -gt 2) { switch ($node.Value.Substring(0, 2)) { - "0o" { + '0o' { $parsedValue = [Convert]::ToInt64($Node.Value.Substring(2), 8) } - "0x" { + '0x' { $parsedValue = [Convert]::ToInt64($Node.Value.Substring(2), 16) } default { if (![System.Numerics.BigInteger]::TryParse($Node.Value, @([Globalization.NumberStyles]::Float, [Globalization.NumberStyles]::Integer), [Globalization.CultureInfo]::InvariantCulture, [ref]$parsedValue)) { - Throw ("failed to parse scalar {0} as long" -f $Node) + throw ('failed to parse scalar {0} as long' -f $Node) } } } } else { if (![System.Numerics.BigInteger]::TryParse($Node.Value, @([Globalization.NumberStyles]::Float, [Globalization.NumberStyles]::Integer), [Globalization.CultureInfo]::InvariantCulture, [ref]$parsedValue)) { - Throw ("failed to parse scalar {0} as long" -f $Node) + throw ('failed to parse scalar {0} as long' -f $Node) } } foreach ($i in $intTypes) { $asIntType = $parsedValue -as $i - if($null -ne $asIntType) { + if ($null -ne $asIntType) { return $asIntType } } return $parsedValue } - "tag:yaml.org,2002:float" { + 'tag:yaml.org,2002:float' { $parsedValue = 0.0 if ($infinityRegex.Matches($Node.Value).Count -gt 0) { $prefix = $Node.Value.Substring(0, 1) switch ($prefix) { - "-" { + '-' { return [double]::NegativeInfinity } default { @@ -188,17 +180,17 @@ function Convert-ValueToProperType { } } if (![decimal]::TryParse($Node.Value, [Globalization.NumberStyles]::Float, [Globalization.CultureInfo]::InvariantCulture, [ref]$parsedValue)) { - Throw ("failed to parse scalar {0} as decimal" -f $Node) + throw ('failed to parse scalar {0} as decimal' -f $Node) } return $parsedValue } - "tag:yaml.org,2002:timestamp" { + 'tag:yaml.org,2002:timestamp' { # From the YAML spec: http://yaml.org/type/timestamp.html [DateTime]$parsedValue = [DateTime]::MinValue $ts = [DateTime]::SpecifyKind($Node.Value, [System.DateTimeKind]::Utc) - $tss = $ts.ToString("o") - if(![datetime]::TryParse($tss, $null, [System.Globalization.DateTimeStyles]::RoundtripKind, [ref] $parsedValue)) { - Throw ("failed to parse scalar {0} as DateTime" -f $Node) + $tss = $ts.ToString('o') + if (![datetime]::TryParse($tss, $null, [System.Globalization.DateTimeStyles]::RoundtripKind, [ref] $parsedValue)) { + throw ('failed to parse scalar {0} as DateTime' -f $Node) } return $parsedValue } @@ -207,34 +199,34 @@ function Convert-ValueToProperType { if ($Node.Style -eq 'Plain') { $parsedValue = New-Object -TypeName ([Boolean].FullName) - $result = [boolean]::TryParse($Node,[ref]$parsedValue) - if( $result ) { + $result = [boolean]::TryParse($Node, [ref]$parsedValue) + if ( $result ) { return $parsedValue } $parsedValue = New-Object -TypeName ([System.Numerics.BigInteger].FullName) $result = [System.Numerics.BigInteger]::TryParse($Node, @([Globalization.NumberStyles]::Float, [Globalization.NumberStyles]::Integer), [Globalization.CultureInfo]::InvariantCulture, [ref]$parsedValue) - if($result) { + if ($result) { $types = @([int], [long]) - foreach($i in $types){ + foreach ($i in $types) { $asType = $parsedValue -as $i - if($null -ne $asType) { + if ($null -ne $asType) { return $asType } } return $parsedValue } $types = @([decimal], [double]) - foreach($i in $types){ + foreach ($i in $types) { $parsedValue = New-Object -TypeName $i.FullName $result = $i::TryParse($Node, [Globalization.NumberStyles]::Float, [Globalization.CultureInfo]::InvariantCulture, [ref]$parsedValue) - if( $result ) { + if ( $result ) { return $parsedValue } } } - if ($Node.Style -eq 'Plain' -and $Node.Value -in '','~','null','Null','NULL') { + if ($Node.Style -eq 'Plain' -and $Node.Value -in '', '~', 'null', 'Null', 'NULL') { return $null } @@ -244,14 +236,14 @@ function Convert-ValueToProperType { function Convert-YamlMappingToHashtable { [CmdletBinding()] - Param( - [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + param( + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] $Node, [switch] $Ordered ) - PROCESS { + process { if ($Ordered) { $ret = [ordered]@{} } else { $ret = @{} } - foreach($i in $Node.Children.Keys) { + foreach ($i in $Node.Children.Keys) { $ret[$i.Value] = Convert-YamlDocumentToPSObject $Node.Children[$i] -Ordered:$Ordered } return $ret @@ -260,36 +252,36 @@ function Convert-YamlMappingToHashtable { function Convert-YamlSequenceToArray { [CmdletBinding()] - Param( - [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + param( + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] $Node, [switch]$Ordered ) - PROCESS { - $ret = [System.Collections.Generic.List[object]](New-Object "System.Collections.Generic.List[object]") - foreach($i in $Node.Children){ + process { + $ret = [System.Collections.Generic.List[object]](New-Object 'System.Collections.Generic.List[object]') + foreach ($i in $Node.Children) { $ret.Add((Convert-YamlDocumentToPSObject $i -Ordered:$Ordered)) } - return ,$ret + return , $ret } } function Convert-YamlDocumentToPSObject { [CmdletBinding()] - Param( - [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + param( + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [System.Object]$Node, [switch]$Ordered ) - PROCESS { - switch($Node.GetType().FullName){ - "YamlDotNet.RepresentationModel.YamlMappingNode"{ + process { + switch ($Node.GetType().FullName) { + 'YamlDotNet.RepresentationModel.YamlMappingNode' { return Convert-YamlMappingToHashtable $Node -Ordered:$Ordered } - "YamlDotNet.RepresentationModel.YamlSequenceNode" { + 'YamlDotNet.RepresentationModel.YamlSequenceNode' { return Convert-YamlSequenceToArray $Node -Ordered:$Ordered } - "YamlDotNet.RepresentationModel.YamlScalarNode" { + 'YamlDotNet.RepresentationModel.YamlScalarNode' { return (Convert-ValueToProperType $Node) } } @@ -297,19 +289,19 @@ function Convert-YamlDocumentToPSObject { } function Convert-HashtableToDictionary { - Param( - [Parameter(Mandatory=$true,ValueFromPipeline=$true)] + param( + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [hashtable]$Data ) - foreach($i in $($data.PSBase.Keys)) { + foreach ($i in $($data.PSBase.Keys)) { $Data[$i] = Convert-PSObjectToGenericObject $Data[$i] } return $Data } function Convert-OrderedHashtableToDictionary { - Param( - [Parameter(Mandatory=$true,ValueFromPipeline=$true)] + param( + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [System.Collections.Specialized.OrderedDictionary] $Data ) foreach ($i in $($data.PSBase.Keys)) { @@ -319,20 +311,20 @@ function Convert-OrderedHashtableToDictionary { } function Convert-ListToGenericList { - Param( - [Parameter(Mandatory=$false,ValueFromPipeline=$true)] - [array]$Data=@() + param( + [Parameter(Mandatory = $false, ValueFromPipeline = $true)] + [array]$Data = @() ) - $ret = [System.Collections.Generic.List[object]](New-Object "System.Collections.Generic.List[object]") - for($i=0; $i -lt $Data.Count; $i++) { + $ret = [System.Collections.Generic.List[object]](New-Object 'System.Collections.Generic.List[object]') + for ($i = 0; $i -lt $Data.Count; $i++) { $ret.Add((Convert-PSObjectToGenericObject $Data[$i])) } - return ,$ret + return , $ret } function Convert-PSObjectToGenericObject { - Param( - [Parameter(Mandatory=$false,ValueFromPipeline=$true)] + param( + [Parameter(Mandatory = $false, ValueFromPipeline = $true)] [System.Object]$Data ) @@ -341,9 +333,9 @@ function Convert-PSObjectToGenericObject { } $dataType = $data.GetType() - if (([System.Collections.Specialized.OrderedDictionary].IsAssignableFrom($dataType))){ + if (([System.Collections.Specialized.OrderedDictionary].IsAssignableFrom($dataType))) { return Convert-OrderedHashtableToDictionary $data - } elseif (([System.Collections.IDictionary].IsAssignableFrom($dataType))){ + } elseif (([System.Collections.IDictionary].IsAssignableFrom($dataType))) { return Convert-HashtableToDictionary $data } elseif (([System.Collections.IList].IsAssignableFrom($dataType))) { return Convert-ListToGenericList $data @@ -353,39 +345,39 @@ function Convert-PSObjectToGenericObject { function ConvertFrom-Yaml { [CmdletBinding()] - Param( - [Parameter(Mandatory=$false, ValueFromPipeline=$true, Position=0)] + param( + [Parameter(Mandatory = $false, ValueFromPipeline = $true, Position = 0)] [string]$Yaml, - [switch]$AllDocuments=$false, + [switch]$AllDocuments = $false, [switch]$Ordered, - [switch]$UseMergingParser=$false + [switch]$UseMergingParser = $false ) - BEGIN { - $d = "" + begin { + $d = '' } - PROCESS { - if($Yaml -is [string]) { + process { + if ($Yaml -is [string]) { $d += $Yaml + "`n" } } - END { - if($d -eq ""){ + end { + if ($d -eq '') { return } $documents = Get-YamlDocuments -Yaml $d -UseMergingParser:$UseMergingParser if (!$documents.Count) { return } - if($documents.Count -eq 1){ + if ($documents.Count -eq 1) { return Convert-YamlDocumentToPSObject $documents[0].RootNode -Ordered:$Ordered } - if(!$AllDocuments) { + if (!$AllDocuments) { return Convert-YamlDocumentToPSObject $documents[0].RootNode -Ordered:$Ordered } $ret = @() - foreach($i in $documents) { + foreach ($i in $documents) { $ret += Convert-YamlDocumentToPSObject $i.RootNode -Ordered:$Ordered } return $ret @@ -393,11 +385,11 @@ function ConvertFrom-Yaml { } function Get-Serializer { - Param( - [Parameter(Mandatory=$true)][SerializationOptions]$Options + param( + [Parameter(Mandatory = $true)][SerializationOptions]$Options ) - $builder = $yamlDotNetAssembly.GetType("YamlDotNet.Serialization.SerializerBuilder")::new() + $builder = $yamlDotNetAssembly.GetType('YamlDotNet.Serialization.SerializerBuilder')::new() $JsonCompatible = $Options.HasFlag([SerializationOptions]::JsonCompatible) if ($Options.HasFlag([SerializationOptions]::Roundtrip)) { @@ -413,7 +405,7 @@ function Get-Serializer { $builder = $builder.JsonCompatible() } if ($Options.HasFlag([SerializationOptions]::DefaultToStaticType)) { - $resolver = $yamlDotNetAssembly.GetType("YamlDotNet.Serialization.TypeResolvers.StaticTypeResolver")::new() + $resolver = $yamlDotNetAssembly.GetType('YamlDotNet.Serialization.TypeResolvers.StaticTypeResolver')::new() $builder = $builder.WithTypeResolver($resolver) } if ($Options.HasFlag([SerializationOptions]::WithIndentedSequences)) { @@ -424,7 +416,7 @@ function Get-Serializer { $useFlowStyle = $Options.HasFlag([SerializationOptions]::UseFlowStyle) $useSequenceFlowStyle = $Options.HasFlag([SerializationOptions]::UseSequenceFlowStyle) - $stringQuoted = $stringQuotedAssembly.GetType("BuilderUtils") + $stringQuoted = $stringQuotedAssembly.GetType('BuilderUtils') $builder = $stringQuoted::BuildSerializer($builder, $omitNull, $useFlowStyle, $useSequenceFlowStyle, $JsonCompatible) return $builder.Build() @@ -432,8 +424,8 @@ function Get-Serializer { function ConvertTo-Yaml { [CmdletBinding(DefaultParameterSetName = 'NoOptions')] - Param( - [Parameter(ValueFromPipeline = $true, Position=0)] + param( + [Parameter(ValueFromPipeline = $true, Position = 0)] [System.Object]$Data, [string]$OutFile, @@ -449,15 +441,15 @@ function ConvertTo-Yaml { [switch]$Force ) - BEGIN { - $d = [System.Collections.Generic.List[object]](New-Object "System.Collections.Generic.List[object]") + begin { + $d = [System.Collections.Generic.List[object]](New-Object 'System.Collections.Generic.List[object]') } - PROCESS { - if($data -is [System.Object]) { + process { + if ($data -is [System.Object]) { $d.Add($data) } } - END { + end { if ($d -eq $null -or $d.Count -eq 0) { return } @@ -468,14 +460,14 @@ function ConvertTo-Yaml { if ($OutFile) { $parent = Split-Path $OutFile if (!(Test-Path $parent)) { - Throw "Parent folder for specified path does not exist" + throw 'Parent folder for specified path does not exist' } if ((Test-Path $OutFile) -and !$Force) { - Throw "Target file already exists. Use -Force to overwrite." + throw 'Target file already exists. Use -Force to overwrite.' } - $wrt = New-Object "System.IO.StreamWriter" $OutFile + $wrt = New-Object 'System.IO.StreamWriter' $OutFile } else { - $wrt = New-Object "System.IO.StringWriter" + $wrt = New-Object 'System.IO.StringWriter' } if ($PSCmdlet.ParameterSetName -eq 'NoOptions') { @@ -489,11 +481,9 @@ function ConvertTo-Yaml { try { $serializer = Get-Serializer $Options $serializer.Serialize($wrt, $norm) - } - catch{ + } catch { $_ - } - finally { + } finally { $wrt.Close() } if ($OutFile) { @@ -507,4 +497,4 @@ function ConvertTo-Yaml { New-Alias -Name cfy -Value ConvertFrom-Yaml New-Alias -Name cty -Value ConvertTo-Yaml -Export-ModuleMember -Function ConvertFrom-Yaml,ConvertTo-Yaml -Alias cfy,cty +Export-ModuleMember -Function ConvertFrom-Yaml, ConvertTo-Yaml -Alias cfy, cty diff --git a/powershell-yaml.sln b/powershell-yaml.sln new file mode 100644 index 0000000..f2d0133 --- /dev/null +++ b/powershell-yaml.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellYamlSerializer", "src\PowerShellYamlSerializer.csproj", "{661F072A-C59E-7ABB-EB12-C69FF3B9328F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {661F072A-C59E-7ABB-EB12-C69FF3B9328F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {661F072A-C59E-7ABB-EB12-C69FF3B9328F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {661F072A-C59E-7ABB-EB12-C69FF3B9328F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {661F072A-C59E-7ABB-EB12-C69FF3B9328F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {65F98BF3-A482-4289-84F9-F224C06DEDA7} + EndGlobalSection +EndGlobal diff --git a/src/PowerShellYamlSerializer.csproj b/src/PowerShellYamlSerializer.csproj index 4732e1e..a38a57d 100644 --- a/src/PowerShellYamlSerializer.csproj +++ b/src/PowerShellYamlSerializer.csproj @@ -1,13 +1,13 @@  - netstandard2.1;net47 + netstandard2.0 - +