C# Class Pdoxcl2Sharp.ParadoxStreamWriter

Inheritance: IDisposable
显示文件 Open project: nickbabcock/Pdoxcl2Sharp Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void

Releases all resources held by the writer

Write ( System.DateTime value ) : void

Writes a DateTime to the stream

Write ( double value ) : void

Writes a double to the stream

Write ( int value ) : void

Writes an integer to the stream

Write ( string value ) : void

Writes a string

Write ( string header, Action objWriter ) : void

Writes a structure that is identified by a header

Write ( string header, IParadoxWrite obj ) : void

Writes a structure that is identified by a header

Write ( string value, ValueWrite type ) : void

Writes a string dictated by a format

Write ( string key, string value ) : void

Writes a key-value pair to the stream with no special formatting

Write ( string key, string value, ValueWrite valuetype ) : void

Writes a key-value pair to the stream with formatting specified by valuetype. It is assumed that the key will be indented and that the value will not be.

WriteComment ( string comment ) : void

Writes a string followed by a line terminator that will be ignored by a paradox parser

WriteLine ( ) : void

Writes a line terminator to the text stream

WriteLine ( string value ) : void

Writes a string followed by a line terminator to the text stream.

WriteLine ( string key, System.DateTime date ) : void

Writes a date and time that is identified by a key. The date is written in a way to conform with how Paradox writes dates

WriteLine ( string value, ValueWrite valuetype ) : void

Writes a string in the format of valuetype followed by a line terminator.

WriteLine ( string key, bool val ) : void

Writes a boolean that is identified by a key. The boolean is written in a way to conform with how Paradox writes booleans.

WriteLine ( string key, double val ) : void

Writes a double that is a identified by a key. The double is written in a way to conform with how Paradox writes doubles.

WriteLine ( string key, int val ) : void

Writes an integer that is identified by a key. The integer is written in a way to conform with how Paradox writes integers.

WriteLine ( string key, string value ) : void

Writes a string value that is identified by a key followed by a line terminator

WriteLine ( string key, string value, ValueWrite valuetype ) : void

Writes a key-value pair followed by a line terminator to the stream with formatting specified by valuetype. It is assumed that the key will be indented and that the value will not be.

Protected Methods

Method Description
Dispose ( bool disposing ) : void
ParadoxStreamWriter ( Stream output ) : System

Private Methods

Method Description
UpdateCurrentIndentFromIndentsIn ( string str ) : void

Given a string, the function will detect squirrely brackets and update the current indent of the writer

Method Details

Dispose() public method

Releases all resources held by the writer
public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

ParadoxStreamWriter() protected method

protected ParadoxStreamWriter ( Stream output ) : System
output Stream
return System

Write() public method

Writes a DateTime to the stream
public Write ( System.DateTime value ) : void
value System.DateTime DateTime to be written
return void

Write() public method

Writes a double to the stream
public Write ( double value ) : void
value double Double to be written
return void

Write() public method

Writes an integer to the stream
public Write ( int value ) : void
value int Integer to be written
return void

Write() public method

Writes a string
public Write ( string value ) : void
value string String to be written
return void

Write() public abstract method

Writes a structure that is identified by a header
public abstract Write ( string header, Action objWriter ) : void
header string The string that will identify the following structure
objWriter Action /// A function that accepts a /// and dictates how the structure will be written ///
return void

Write() public method

Writes a structure that is identified by a header
public Write ( string header, IParadoxWrite obj ) : void
header string The string that will identify the following structure
obj IParadoxWrite The that dictates how the structure will be written
return void

Write() public method

Writes a string dictated by a format
public Write ( string value, ValueWrite type ) : void
value string String to be written
type ValueWrite Denotes what modifications to be made on the string before being written
return void

Write() public method

Writes a key-value pair to the stream with no special formatting
public Write ( string key, string value ) : void
key string Key that identifies the value
value string Value to be written to the stream
return void

Write() public abstract method

Writes a key-value pair to the stream with formatting specified by valuetype. It is assumed that the key will be indented and that the value will not be.
public abstract Write ( string key, string value, ValueWrite valuetype ) : void
key string Key that identifies the value
value string Value to be written to the stream
valuetype ValueWrite Dictates how the value should be written to the stream.
return void

WriteComment() public abstract method

Writes a string followed by a line terminator that will be ignored by a paradox parser
public abstract WriteComment ( string comment ) : void
comment string The string to be written to the file but ignored on parse
return void

WriteLine() public method

Writes a line terminator to the text stream
public WriteLine ( ) : void
return void

WriteLine() public method

Writes a string followed by a line terminator to the text stream.
public WriteLine ( string value ) : void
value string The string to write. If value is null, only the line termination characters are written
return void

WriteLine() public abstract method

Writes a date and time that is identified by a key. The date is written in a way to conform with how Paradox writes dates
public abstract WriteLine ( string key, System.DateTime date ) : void
key string Key to be written
date System.DateTime Date to be written
return void

WriteLine() public abstract method

Writes a string in the format of valuetype followed by a line terminator.
public abstract WriteLine ( string value, ValueWrite valuetype ) : void
value string The string to be written to the text stream
valuetype ValueWrite The format of how the string should be written
return void

WriteLine() public method

Writes a boolean that is identified by a key. The boolean is written in a way to conform with how Paradox writes booleans.
public WriteLine ( string key, bool val ) : void
key string Key to be written
val bool Boolean to be written
return void

WriteLine() public method

Writes a double that is a identified by a key. The double is written in a way to conform with how Paradox writes doubles.
public WriteLine ( string key, double val ) : void
key string Key to be written.
val double Double to be written
return void

WriteLine() public method

Writes an integer that is identified by a key. The integer is written in a way to conform with how Paradox writes integers.
public WriteLine ( string key, int val ) : void
key string Key that identifies the value
val int Value to the be written to the stream
return void

WriteLine() public method

Writes a string value that is identified by a key followed by a line terminator
public WriteLine ( string key, string value ) : void
key string The text can identify the value
value string Value to be written
return void

WriteLine() public abstract method

Writes a key-value pair followed by a line terminator to the stream with formatting specified by valuetype. It is assumed that the key will be indented and that the value will not be.
public abstract WriteLine ( string key, string value, ValueWrite valuetype ) : void
key string Key that identifies the value
value string Value to be written to the stream
valuetype ValueWrite Dictates how the value should be written to the stream
return void