RTK  2.1.0
Reconstruction Toolkit
Public Member Functions | Private Attributes | List of all members
rtk::DbfFile Class Reference

#include <rtkDbf.h>

+ Collaboration diagram for rtk::DbfFile:

Public Member Functions

double GetFieldAsDouble (std::string fldName)
std::string GetFieldAsString (std::string fldName)
vcl_size_t GetNumberOfRecords ()
bool is_open ()
bool ReadNextRecord ()
 DbfFile (std::string fileName)
 ~DbfFile ()

Private Attributes

std::vector< DbfFieldm_Fields
unsigned short m_HeaderSize
std::map< std::string, unsigned int > m_MapFieldNameIndex
unsigned int m_NumRecords
char * m_Record
unsigned short m_RecordSize
std::ifstream m_Stream

Detailed Description

Light dbase file (.dbf) file reader. It assumes little-endianness (least significant byte first). The format describet on this page: http://www.dbf2002.com/dbf-file-format.html

Simon Rit

Definition at line 87 of file rtkDbf.h.

Constructor & Destructor Documentation

◆ DbfFile()

rtk::DbfFile::DbfFile ( std::string  fileName)

Constructor initializes the structure and goes to first record

◆ ~DbfFile()

rtk::DbfFile::~DbfFile ( )

Constructor initializes the structure and goes to first record

Member Function Documentation

◆ GetFieldAsDouble()

double rtk::DbfFile::GetFieldAsDouble ( std::string  fldName)

Definition at line 119 of file rtkDbf.h.

References GetFieldAsString().

◆ GetFieldAsString()

std::string rtk::DbfFile::GetFieldAsString ( std::string  fldName)

Access to field value of field named fldName

Referenced by GetFieldAsDouble().

◆ GetNumberOfRecords()

vcl_size_t rtk::DbfFile::GetNumberOfRecords ( )

Number of records contained in the tabe

Definition at line 104 of file rtkDbf.h.

References m_Fields.

◆ is_open()

bool rtk::DbfFile::is_open ( )

Return open status of file stream

Definition at line 97 of file rtkDbf.h.

References m_Stream.

◆ ReadNextRecord()

bool rtk::DbfFile::ReadNextRecord ( )

Read in memory the next record. Return true if successful and false oftherwise.

Member Data Documentation

◆ m_Fields

std::vector<DbfField> rtk::DbfFile::m_Fields

Set of fields described in the header

Definition at line 134 of file rtkDbf.h.

Referenced by GetNumberOfRecords().

◆ m_HeaderSize

unsigned short rtk::DbfFile::m_HeaderSize

Definition at line 131 of file rtkDbf.h.

◆ m_MapFieldNameIndex

std::map<std::string, unsigned int> rtk::DbfFile::m_MapFieldNameIndex

Map between field names and field index

Definition at line 137 of file rtkDbf.h.

◆ m_NumRecords

unsigned int rtk::DbfFile::m_NumRecords

Global properties of a dbf file

Definition at line 129 of file rtkDbf.h.

◆ m_Record

char* rtk::DbfFile::m_Record

Current record in memory

Definition at line 140 of file rtkDbf.h.

◆ m_RecordSize

unsigned short rtk::DbfFile::m_RecordSize

Definition at line 130 of file rtkDbf.h.

◆ m_Stream

std::ifstream rtk::DbfFile::m_Stream

File stream. AFter constructor, positionned to next record to read.

Definition at line 126 of file rtkDbf.h.

Referenced by is_open().

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