Version 2.1.0.0

BaseDataReaderWriter class

Namespace: Sirenix.Serialization
Assembly: Sirenix.Serialization
public abstract class BaseDataReaderWriter
Implements functionality that is shared by both data readers and data writers.
Inheritance
  • System.Object
  • BaseDataReaderWriter

Constructors

BaseDataReaderWriter()
protected BaseDataReaderWriter()

Properties

CurrentNode
Gets the current node, or Empty if there is no current node.
protected NodeInfo CurrentNode { get; }
IsInArrayNode
Gets a value indicating whether the reader or writer is in an array node.
public bool IsInArrayNode { get; }
NodeDepth
Gets the current node depth. In other words, the current count of the node stack.
protected int NodeDepth { get; }

Methods

ClearNodes()
protected void ClearNodes()
PopArray()
Pops the current node if the current node is an array node.
protected void PopArray()
PopNode(String)
Pops the current node off of the node stack.
protected void PopNode(string name)
Parameters
System.String name

The name of the node to pop.

Exceptions
System.InvalidOperationException

There are no nodes to pop. or Tried to pop node with given name, but the current node's name was different.

PushArray()
Pushes an array node onto the node stack. This uses values from the current node to provide extra info about the array node.
protected void PushArray()
PushNode(NodeInfo)
Pushes a node onto the node stack.
protected void PushNode(NodeInfo node)
Parameters
NodeInfo node

The node to push.

PushNode(String, Int32, Type)
Pushes a node with the given name, id and type onto the node stack.
protected void PushNode(string name, int id, Type type)
Parameters
System.String name

The name of the node.

System.Int32 id

The id of the node.

System.Type type

The type of the node.

Derived Classes

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.