netcore-csv
Public Member Functions | List of all members
CsvWriter< T > Class Template Reference

write object data to csv as row autogenerating first row header using object properties as name and order. attributes CsvHeaderAttribute and CsvColumnOrderAttribute can be specified on properties to custommize header and order. More...

Inheritance diagram for CsvWriter< T >:
Inheritance graph
[legend]
Collaboration diagram for CsvWriter< T >:
Collaboration graph
[legend]

Public Member Functions

 CsvWriter (string pathfilename, CsvOptions opts=null)
 construct a csv writer to write on given filename with field and decimal separators.
More...
 
 CsvWriter (string pathfilename, bool append, CsvOptions opts=null)
 construct a csv writer to write on given filename with field and decimal separators.
data will appended if file exists More...
 
void Push (T obj)
 write a csv row getting data from given object public properties More...
 
void Dispose ()
 dispose the writer closing writer stream More...
 
- Public Member Functions inherited from CsvFile< T >
 CsvFile (string pathfilename, CsvOptions options)
 csv reader/writer base class.
More...
 
 CsvFile (string pathfilename, bool append, CsvOptions options)
 csv reader/writer base class.
More...
 

Additional Inherited Members

- Properties inherited from CsvFile< T >
string Pathfilename [get]
 
CsvOptions Options [get]
 
char StringDelimiter [get]
 
char FieldSeparator [get]
 
char DecimalSeparator [get]
 
bool DecimalSeparatorIsInvariant [get]
 
IReadOnlyList< CsvColumnColumns [get]
 
bool AppendMode [get]
 if file exists with size great than 0 then header will not placed else file will overwritten with new starting header,
More...
 

Detailed Description

write object data to csv as row autogenerating first row header using object properties as name and order. attributes CsvHeaderAttribute and CsvColumnOrderAttribute can be specified on properties to custommize header and order.

Type Constraints
T :class 

Constructor & Destructor Documentation

◆ CsvWriter() [1/2]

CsvWriter ( string  pathfilename,
CsvOptions  opts = null 
)

construct a csv writer to write on given filename with field and decimal separators.

◆ CsvWriter() [2/2]

CsvWriter ( string  pathfilename,
bool  append,
CsvOptions  opts = null 
)

construct a csv writer to write on given filename with field and decimal separators.
data will appended if file exists

Member Function Documentation

◆ Dispose()

void Dispose ( )

dispose the writer closing writer stream

◆ Push()

void Push ( obj)

write a csv row getting data from given object public properties


The documentation for this class was generated from the following file: