Module to load and save DBF files
Authors | Carlos Santander Bernal |
Version | 0.5 |
Date | February 25, 2013 |
History |
|
License | zlib/libpng |
See Also |
Simple class to access a DBF file.
Loading and saving are performed from wherever the stream is at that moment, and the stream is not closed after loading or saving. All this means that if you have a Stream which contains more than just the DBF, you can keep using it.
Bugs |
|
Examples | string file = args[1]; DBF dbf = new DBF (file); dbf.read(); ... void foo (Stream stream) { (new DBF(stream)).load(); } |
See Also | Mango |
Initializes the DBF from a Stream
Parameters |
|
Initializes the DBF from a file
Parameters |
|
Loads the DBF from the specified source
Saves the DBF to the specified source
Returns the number of records
Returns the number of fields
Returns the name of a field by its index
Returns the index of a field by its name
Removes a field from this DBF
Throws | DBFException if there's no field named name |
Removes a field from this DBF
Throws | DBFException if index is greater than the number of fields |
Adds a field to this DBF
If type == DataType.Number, flength represents the fieldLength, and the decimalCount is set to 0.
If type == DataType.Date, flength is ignored and automatically set to 8.
This method fails if there're already records in the DBF. To modify the fields in the DBF, you must first remove all its records.
Parameters |
|
Throws | DBFException if there're records in the DBF or if there's already a field with this name |
Adds a numeric field to this DBF
This method fails if there're already records in the DBF. To modify the fields in the DBF, you must first remove all its records.
Parameters |
|
Throws | DBFException if there're records in the DBF or if there's already a field with this name |
Adds a date field to this DBF
This method fails if there're already records in the DBF. To modify the fields in the DBF, you must first remove all its records.
Parameters |
|
Throws | DBFException if there're records in the DBF or if there's already a field with this name |
Foreach the fields of this DBF
Foreach the records of this DBF
Removes a record from this DBF
Throws | DBFException if index is greater than the number of records |
Removes all records from this DBF
Adds a record to this DBF
This record contains no data and the fields must be explicitly filled by the user. However, it already belongs to the DBF.
Adds a record to this DBF
The types passed here must be compatible with those defined by the fields.