C# Class EpLibrary.cs.BaseTextFile

A class for Base File.
Datei anzeigen Open project: juhgiyo/EpLibrary.cs Class Usage Examples

Protected Properties

Property Type Description
m_baseTextLock Object
m_encoding System.Text.Encoding
m_reader System.IO.StreamReader
m_writer System.IO.StreamWriter

Public Methods

Method Description
AppendToFile ( String filename ) : bool

Append the text from the given file

BaseTextFile ( BaseTextFile b ) : System

Default Copy Constructor

BaseTextFile ( Encoding encoding = null ) : System

Default Constructor

GetEncoding ( ) : Encoding

Get current encoding

LoadFromFile ( String filename ) : bool

Load the list of the properties from the given file

SaveToFile ( String filename ) : bool

Save the text to the given file

SetEncoding ( Encoding encoding ) : void

Set encoding as given encoding

Protected Methods

Method Description
loadFromFile ( StreamReader stream ) : void

Actual load Function that loads values from the file.

Sub classes should implement this function

writeLoop ( ) : void

Loop Function that writes to the file.

Sub classes should implement this function

writeToFile ( String toFileString ) : void

Write the given string to the file

Method Details

AppendToFile() public method

Append the text from the given file
public AppendToFile ( String filename ) : bool
filename String the name of the file to append
return bool

BaseTextFile() public method

Default Copy Constructor
public BaseTextFile ( BaseTextFile b ) : System
b BaseTextFile the second object
return System

BaseTextFile() public method

Default Constructor
public BaseTextFile ( Encoding encoding = null ) : System
encoding System.Text.Encoding the encoding type for this file
return System

GetEncoding() public method

Get current encoding
public GetEncoding ( ) : Encoding
return System.Text.Encoding

LoadFromFile() public method

Load the list of the properties from the given file
public LoadFromFile ( String filename ) : bool
filename String the name of the file to load
return bool

SaveToFile() public method

Save the text to the given file
public SaveToFile ( String filename ) : bool
filename String the name of the file to save
return bool

SetEncoding() public method

Set encoding as given encoding
public SetEncoding ( Encoding encoding ) : void
encoding System.Text.Encoding encoding to set
return void

loadFromFile() protected abstract method

Actual load Function that loads values from the file.
Sub classes should implement this function
protected abstract loadFromFile ( StreamReader stream ) : void
stream System.IO.StreamReader stream from the file
return void

writeLoop() protected abstract method

Loop Function that writes to the file.
Sub classes should implement this function
protected abstract writeLoop ( ) : void
return void

writeToFile() protected method

Write the given string to the file
protected writeToFile ( String toFileString ) : void
toFileString String the string to write to the file
return void

Property Details

m_baseTextLock protected_oe property

lock
protected Object m_baseTextLock
return Object

m_encoding protected_oe property

Encoding
protected Encoding,System.Text m_encoding
return System.Text.Encoding

m_reader protected_oe property

reader stream
protected StreamReader,System.IO m_reader
return System.IO.StreamReader

m_writer protected_oe property

writer stream
protected StreamWriter,System.IO m_writer
return System.IO.StreamWriter