C# Класс Azavea.NijPredictivePolicing.Common.Data.GenericSeparatedValueWriter

a basic implementation of the IDataWriter interface, so we can simply export tab separated value files
Наследование: IDataFileWriter
Показать файл Открыть проект

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

Свойство Тип Описание
_filename string
_line StringBuilder
_outputStream System.IO.StreamWriter
_splitChars char[]

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

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

closes the underlying stream

CreateTable ( string tablename, IEnumerable columns ) : bool
Flush ( ) : bool

flushes the stream

GenericSeparatedValueWriter ( ) : System

construct a new blank writer (any writes will throw exceptions if you don't set a stream or a file!)

GenericSeparatedValueWriter ( string filename, char delims ) : System

construct a new writer to append to the given file

MakeColumnLine ( List columns ) : string

allows you to use any functional writable stream

generate the first column properly

MakeFormatLine ( List columns ) : string

generate the first column properly

SetTablename ( string tableName ) : void
SetWriteFile ( string filename ) : bool

specify an output file for APPENDing to, and sharing reading. (if you don't like it, send in your own filestream :)

WriteLine ( IEnumerable values ) : bool

Make sure you have a value for every column! This is really intentionally not thread safe, do not share this class across threads.

WriteLine ( string line ) : bool

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

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

closes the underlying stream
public Close ( ) : bool
Результат bool

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

public CreateTable ( string tablename, IEnumerable columns ) : bool
tablename string
columns IEnumerable
Результат bool

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

flushes the stream
public Flush ( ) : bool
Результат bool

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

construct a new blank writer (any writes will throw exceptions if you don't set a stream or a file!)
public GenericSeparatedValueWriter ( ) : System
Результат System

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

construct a new writer to append to the given file
public GenericSeparatedValueWriter ( string filename, char delims ) : System
filename string
delims char
Результат System

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

allows you to use any functional writable stream generate the first column properly
public MakeColumnLine ( List columns ) : string
columns List
Результат string

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

generate the first column properly
public MakeFormatLine ( List columns ) : string
columns List
Результат string

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

public SetTablename ( string tableName ) : void
tableName string
Результат void

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

specify an output file for APPENDing to, and sharing reading. (if you don't like it, send in your own filestream :)
public SetWriteFile ( string filename ) : bool
filename string
Результат bool

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

Make sure you have a value for every column! This is really intentionally not thread safe, do not share this class across threads.
public WriteLine ( IEnumerable values ) : bool
values IEnumerable
Результат bool

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

public WriteLine ( string line ) : bool
line string
Результат bool

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

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

an internal copy of our filename
protected string _filename
Результат string

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

our buffer for constructing lines
protected StringBuilder _line
Результат StringBuilder

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

our wrapper around any provided stream
protected StreamWriter,System.IO _outputStream
Результат System.IO.StreamWriter

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

the tab, for the tab-separated part
protected char[] _splitChars
Результат char[]