C# Класс Depressurizer.VdfFileNode

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
NodeData Object
NodeType System.ValueType

Открытые методы

Метод Описание
CleanTree ( ) : void

Removes any array nodes without any value-type children

ContainsKey ( string key ) : bool

Checks whether the given key exists within an array-type node

GetNodeAt ( string args, bool create = true, int index ) : VdfFileNode

Gets the node at the given address. May be used to build structure.

LoadFromBinary ( BinaryReader stream, long streamLength = -1 ) : VdfFileNode

Loads a FileNode from stream.

LoadFromText ( StreamReader stream, bool useFirstAsRoot = false ) : VdfFileNode

Loads a FileNode from stream.

MakeArray ( ) : void
ReadBin_SeekTo ( BinaryReader stream, byte str, long fileLength ) : void
RemoveSubnode ( string key ) : bool

Removes the subnode with the given key. Can only be called on array nodes.

SaveAsBinary ( BinaryWriter stream, string actualKey = null ) : void

Writes this FileNode and childs to a stream

SaveAsText ( StreamWriter stream, int indent ) : void

Writes this FileNode to a stream

VdfFileNode ( ) : System

Creates a new array-type node

VdfFileNode ( int value ) : System

Creates a new integer-type node

VdfFileNode ( string value ) : System

Creates a new string-type node

VdfFileNode ( ulong value ) : System

Creates a new UInt64-type node

this ( string key ) : VdfFileNode

Gets or sets the subnode with the given key. Can only be used with an array node. If the subnode does not exist, creates it as an array type.

Защищенные методы

Метод Описание
IsEmpty ( ) : bool

Checks whether or not this node has any children

Приватные методы

Метод Описание
ReadBin_GetStringToken ( BinaryReader reader, long streamLength = -1 ) : string

Reads from the specified stream until it reaches a string terminator (double quote with no escaping slash). The opening double quote should already be read, and the last one will be discarded.

ReadText_GetStringToken ( StreamReader stream ) : string

Reads a from the specified stream until it reaches a string terminator (double quote with no escaping slash). The opening double quote should already be read, and the last one will be discarded.

ReadText_SkipWhitespace ( StreamReader stream ) : void

Advances a stream until the next character is not whitespace

WriteBin_WriteArrayKey ( BinaryWriter writer, string arrayKey ) : void

Writes a array key to a stream, adding start/end bytes.

WriteBin_WriteEndByte ( BinaryWriter writer ) : void

Write an end byte to stream

WriteBin_WriteIntegerValue ( BinaryWriter writer, string key, int val ) : void
WriteBin_WriteStringValue ( BinaryWriter writer, string key, string val ) : void

Writes a pair o key and value to a stream, adding star/end and separator bytes

WriteText_WriteFormattedString ( StreamWriter stream, string s ) : void

Writes a string to a stream, adding start/end quotes and escaping any quotes within the string.

WriteText_WriteWhitespace ( StreamWriter stream, int indent ) : void

Writes the given number of tab characters to a stream

Описание методов

CleanTree() публичный Метод

Removes any array nodes without any value-type children
public CleanTree ( ) : void
Результат void

ContainsKey() публичный Метод

Checks whether the given key exists within an array-type node
public ContainsKey ( string key ) : bool
key string The key to look for
Результат bool

GetNodeAt() публичный Метод

Gets the node at the given address. May be used to build structure.
public GetNodeAt ( string args, bool create = true, int index ) : VdfFileNode
args string An ordered list of keys, like a path
create bool If true, will create any nodes it does not find along the path.
index int Start index of the arg array
Результат VdfFileNode

IsEmpty() защищенный Метод

Checks whether or not this node has any children
protected IsEmpty ( ) : bool
Результат bool

LoadFromBinary() публичный статический Метод

Loads a FileNode from stream.
public static LoadFromBinary ( BinaryReader stream, long streamLength = -1 ) : VdfFileNode
stream System.IO.BinaryReader Stream to load from
streamLength long
Результат VdfFileNode

LoadFromText() публичный статический Метод

Loads a FileNode from stream.
public static LoadFromText ( StreamReader stream, bool useFirstAsRoot = false ) : VdfFileNode
stream System.IO.StreamReader Stream to load from
useFirstAsRoot bool
Результат VdfFileNode

MakeArray() публичный Метод

public MakeArray ( ) : void
Результат void

ReadBin_SeekTo() публичный статический Метод

public static ReadBin_SeekTo ( BinaryReader stream, byte str, long fileLength ) : void
stream System.IO.BinaryReader
str byte
fileLength long
Результат void

RemoveSubnode() публичный Метод

Removes the subnode with the given key. Can only be called on array nodes.
public RemoveSubnode ( string key ) : bool
key string Key of the subnode to remove
Результат bool

SaveAsBinary() публичный Метод

Writes this FileNode and childs to a stream
public SaveAsBinary ( BinaryWriter stream, string actualKey = null ) : void
stream System.IO.BinaryWriter Stream to write to
actualKey string Name of node to write.
Результат void

SaveAsText() публичный Метод

Writes this FileNode to a stream
public SaveAsText ( StreamWriter stream, int indent ) : void
stream System.IO.StreamWriter Stream to write to
indent int Indentation level of each line.
Результат void

VdfFileNode() публичный Метод

Creates a new array-type node
public VdfFileNode ( ) : System
Результат System

VdfFileNode() публичный Метод

Creates a new integer-type node
public VdfFileNode ( int value ) : System
value int Value of the integer
Результат System

VdfFileNode() публичный Метод

Creates a new string-type node
public VdfFileNode ( string value ) : System
value string Value of the string
Результат System

VdfFileNode() публичный Метод

Creates a new UInt64-type node
public VdfFileNode ( ulong value ) : System
value ulong Value of the unsigned 64-bit integer
Результат System

this() публичный Метод

Gets or sets the subnode with the given key. Can only be used with an array node. If the subnode does not exist, creates it as an array type.
Thrown if used on a value node.
public this ( string key ) : VdfFileNode
key string Key to look for or set
Результат VdfFileNode

Описание свойств

NodeData публичное свойство

public Object NodeData
Результат Object

NodeType публичное свойство

public ValueType,System NodeType
Результат System.ValueType