Interface IObjectWriter
- Namespace
- NuGet.RuntimeModel
- Assembly
- Chocolatey.NuGet.Packaging.dll
Provides functionality for writing an object graph. The output format is defined by implementors.
public interface IObjectWriter
Methods
WriteArrayEnd()
Writes the end of an array.
The parent object for this array becomes the scope for subsequent method calls. If this object is the root object, no further writing is allowed.
Every call to WriteArrayStart needs to be balanced with a corresponding call to WriteArrayEnd and not WriteObjectEnd.
void WriteArrayEnd()
Exceptions
- ObjectDisposedException
Thrown if this object is disposed.
WriteArrayStart(string)
Writes the start of an array. The new object becomes the scope of all other methods until WriteArrayStart is called to start a new object in the array, or WriteArrayEnd is called. Every call to WriteArrayStart needs to be balanced with a corresponding call to WriteArrayEnd and not WriteObjectEnd.
void WriteArrayStart(string name)
Parameters
name
stringThe array name
Exceptions
- ArgumentNullException
Thrown if
name
isnull
.- ObjectDisposedException
Thrown if this object is disposed.
WriteNameArray(string, IEnumerable<string>)
Writes a name-collection pair.
void WriteNameArray(string name, IEnumerable<string> values)
Parameters
name
stringThe name of the data.
values
IEnumerable<string>The data.
Exceptions
- ArgumentNullException
Thrown if
name
isnull
.- ObjectDisposedException
Thrown if this object is disposed.
WriteNameValue(string, bool)
Writes a name-value pair.
void WriteNameValue(string name, bool value)
Parameters
Exceptions
- ArgumentNullException
Thrown if
name
isnull
.- ObjectDisposedException
Thrown if this object is disposed.
WriteNameValue(string, int)
Writes a name-value pair.
void WriteNameValue(string name, int value)
Parameters
Exceptions
- ArgumentNullException
Thrown if
name
isnull
.- ObjectDisposedException
Thrown if this object is disposed.
WriteNameValue(string, string)
Writes a name-value pair.
void WriteNameValue(string name, string value)
Parameters
Exceptions
- ArgumentNullException
Thrown if
name
isnull
.- ObjectDisposedException
Thrown if this object is disposed.
WriteObjectEnd()
Writes the end of a nested object.
The parent object for this object becomes the scope for subsequent method calls. If this object is the root object, no further writing is allowed.
Every call to WriteObjectStart must be balanced by a corresponding call to WriteObjectEnd.
void WriteObjectEnd()
Exceptions
- ObjectDisposedException
Thrown if this object is disposed.
WriteObjectStart()
Writes the start of the root object or an object in an array.
This new object becomes the scope for all other method calls until either WriteObjectStart is called again to start a new nested object or WriteObjectEnd is called.
Every call to WriteObjectStart must be balanced by a corresponding call to WriteObjectEnd.
void WriteObjectStart()
Exceptions
- ObjectDisposedException
Thrown if this object is disposed.
WriteObjectStart(string)
Writes the start of a nested object.
This new object becomes the scope for all other method calls until either WriteObjectStart is called again to start a new nested object or WriteObjectEnd is called.
Every call to WriteObjectStart must be balanced by a corresponding call to WriteObjectEnd.
void WriteObjectStart(string name)
Parameters
name
stringThe name of the object.
Exceptions
- ArgumentNullException
Thrown if
name
isnull
.- ObjectDisposedException
Thrown if this object is disposed.