Parser Class
Represents the Parser.
public static class ParserMethods
| Name | Description |
|---|---|
| CreateParser(TextReader) | Creates a YAML parser with the default maximum nesting depth. |
| CreateParser(TextReader, int) | Creates a YAML parser with a configurable maximum nesting depth. |
| CreateParser(TextReader, int, string?) | Creates a YAML parser with a configurable maximum nesting depth and optional source name. |
CreateParser overloads
CreateParser(TextReader)
Parser.csCreates a YAML parser with the default maximum nesting depth.
public static IParser CreateParser(TextReader reader)Parameters
readerTextReader- The YAML reader.
Returns
IParser The parser.
Exceptions
ArgumentNullExceptionreaderisnull.
CreateParser(TextReader, int)
Parser.csCreates a YAML parser with a configurable maximum nesting depth.
public static IParser CreateParser(TextReader reader, int maxDepth)Parameters
readerTextReader- The YAML reader.
maxDepthint- The maximum allowed nesting depth for mappings and sequences. A value of
0uses the default limit of 64.
Returns
IParser The parser.
Exceptions
ArgumentNullExceptionreaderisnull.ArgumentOutOfRangeExceptionmaxDepthis less than 0.
CreateParser(TextReader, int, string?)
Parser.csCreates a YAML parser with a configurable maximum nesting depth and optional source name.
public static IParser CreateParser(TextReader reader, int maxDepth, string? sourceName)Parameters
readerTextReader- The YAML reader.
maxDepthint- The maximum allowed nesting depth for mappings and sequences. A value of
0uses the default limit of 64. sourceNamestring?- An optional source name associated with the YAML payload, such as a file path, used when reporting depth-limit failures.
Returns
IParser The parser.
Exceptions
ArgumentNullExceptionreaderisnull.ArgumentOutOfRangeExceptionmaxDepthis less than 0.