C# Класс EpLibrary.cs.BaseTextFile

A class for Base File.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
m_baseTextLock Object
m_encoding System.Text.Encoding
m_reader System.IO.StreamReader
m_writer System.IO.StreamWriter

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

Метод Описание
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

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

Метод Описание
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

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

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

Append the text from the given file
public AppendToFile ( String filename ) : bool
filename String the name of the file to append
Результат bool

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

Default Copy Constructor
public BaseTextFile ( BaseTextFile b ) : System
b BaseTextFile the second object
Результат System

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

Default Constructor
public BaseTextFile ( Encoding encoding = null ) : System
encoding System.Text.Encoding the encoding type for this file
Результат System

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

Get current encoding
public GetEncoding ( ) : Encoding
Результат System.Text.Encoding

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

Load the list of the properties from the given file
public LoadFromFile ( String filename ) : bool
filename String the name of the file to load
Результат bool

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

Save the text to the given file
public SaveToFile ( String filename ) : bool
filename String the name of the file to save
Результат bool

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

Set encoding as given encoding
public SetEncoding ( Encoding encoding ) : void
encoding System.Text.Encoding encoding to set
Результат void

loadFromFile() защищенный абстрактный Метод

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
Результат void

writeLoop() защищенный абстрактный Метод

Loop Function that writes to the file.
Sub classes should implement this function
protected abstract writeLoop ( ) : void
Результат void

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

Write the given string to the file
protected writeToFile ( String toFileString ) : void
toFileString String the string to write to the file
Результат void

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

m_baseTextLock защищенное свойство

lock
protected Object m_baseTextLock
Результат Object

m_encoding защищенное свойство

Encoding
protected Encoding,System.Text m_encoding
Результат System.Text.Encoding

m_reader защищенное свойство

reader stream
protected StreamReader,System.IO m_reader
Результат System.IO.StreamReader

m_writer защищенное свойство

writer stream
protected StreamWriter,System.IO m_writer
Результат System.IO.StreamWriter