C# Class MapAround.IO.DbaseFileHeader

Represents a header of dBase-file.
Exibir arquivo Open project: gkrsu/maparound.core Class Usage Examples

Public Methods

Method Description
AddColumn ( string fieldName, Type dataType ) : void

Adds a column.

AddColumn ( string fieldName, char fieldType, Type DataType, int fieldLength, int decimalCount ) : void

Adds a column.

DbaseFileHeader ( ) : System

Initializes a new instance of MapAround.IO.DbaseFileHeader.

Read ( BinaryReader reader ) : void

Reads a dBase header.

RecountColumnLength ( DbaseFieldDescriptor field, IEnumerable columnValues ) : void

Computes a maximum length of field taking into account all the values.

RemoveColumn ( string fieldName ) : int

Removes a column.

Write ( BinaryWriter writer ) : void

Writes a dBase header into stream.

Private Methods

Method Description
getDbaseLanguageDriver ( byte dbasecode ) : Encoding
getDbaseLanguageDriver ( int dbasecode ) : byte

Method Details

AddColumn() public method

Adds a column.
public AddColumn ( string fieldName, Type dataType ) : void
fieldName string A filed name
dataType System.Type A CLR data type
return void

AddColumn() public method

Adds a column.
public AddColumn ( string fieldName, char fieldType, Type DataType, int fieldLength, int decimalCount ) : void
fieldName string A filed name
fieldType char A character defining a dBAse filed type (C N L or D)
DataType System.Type A CLR data type
fieldLength int A length of field in bytes
decimalCount int A number of decimal characters
return void

DbaseFileHeader() public method

Initializes a new instance of MapAround.IO.DbaseFileHeader.
public DbaseFileHeader ( ) : System
return System

Read() public method

Reads a dBase header.
public Read ( BinaryReader reader ) : void
reader System.IO.BinaryReader A System.IO.BinaryReader instance to read header
return void

RecountColumnLength() public method

Computes a maximum length of field taking into account all the values.
public RecountColumnLength ( DbaseFieldDescriptor field, IEnumerable columnValues ) : void
field DbaseFieldDescriptor A descriptor of field
columnValues IEnumerable A field value enumerator
return void

RemoveColumn() public method

Removes a column.
public RemoveColumn ( string fieldName ) : int
fieldName string A filed name
return int

Write() public method

Writes a dBase header into stream.
public Write ( BinaryWriter writer ) : void
writer System.IO.BinaryWriter A System.IO.BinaryWriter instance to write header
return void