WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
WXP::CityFile Class Reference

This class reads in data from city database files. More...

#include "../include/CityFile.h"

Public Member Functions

 CityFile ()
 CityFile (const char *filename, int access)
 CityFile (const char *filename)
 ~CityFile ()
int open (const char *filename, int access)
int open (const char *filename)
bool isOpen ()
int rewind ()
int close ()
int read (CityData &city)
int getNum ()

Detailed Description

This class reads in data from city database files.

Author
Dan Vietor

Constructor & Destructor Documentation

◆ CityFile() [1/3]

CityFile::CityFile ( )

Constructor. Initializes values

◆ CityFile() [2/3]

CityFile::CityFile ( const char * filename,
int access )

Constructor. Opens file

Parameters
filenameFile to open
accessFile access (FileAttr::READ, FileAttr::WRITE)

References open().

◆ CityFile() [3/3]

CityFile::CityFile ( const char * filename)

Constructor. Opens file for read

Parameters
filenameFile to open

References open(), and WXP::FileAttr::READ.

◆ ~CityFile()

CityFile::~CityFile ( )

Destructor. Closes file

References close().

Member Function Documentation

◆ close()

int CityFile::close ( )

Closes the file and marks the class as closed

Referenced by WXP::CityPlot::draw(), and ~CityFile().

◆ getNum()

int CityFile::getNum ( )

Returns an estimate for the number of cities in the file

Referenced by WXP::CityHash::setup(), WXP::CityHash::setup(), and WXP::UpaRawinHash::setup().

◆ isOpen()

◆ open() [1/2]

int CityFile::open ( const char * filename)

Opens the city database file for read

Parameters
filenameFile to open

References open(), and WXP::FileAttr::READ.

◆ open() [2/2]

int CityFile::open ( const char * filename,
int access )

Opens the city database file

Parameters
filenameFile to open
accessFile access (FileAttr::READ, FileAttr::WRITE)

References WXP::FileTool::getSize(), WXP::FileAttr::READ, and WXP::FileAttr::WRITE.

Referenced by CityFile(), CityFile(), and open().

◆ read()

int CityFile::read ( CityData & city)

Reads a single city from the database file

Return values
cityData object to hold city data
Returns
0=not opened, bad data or no more data, 1=valid

References WXP::StrLib::equal(), and WXP::Const::MISS.

Referenced by WXP::CityPlot::draw(), WXP::ProfPlot::draw(), WXP::UpaXSectCont::draw(), WXP::UpaXSectPlot::draw(), WXP::CityTool::search(), WXP::CityHash::setup(), WXP::CityHash::setup(), WXP::RcmDecode::setup(), and WXP::UpaRawinHash::setup().

◆ rewind()

int CityFile::rewind ( )

Rewinds the file

Referenced by WXP::CityTool::search().


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