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

This class reads data from a WXP map file. More...

#include "../include/MapWxpFile.h"

Public Types

enum  Type { UNK , BINARY , ASCII }

Public Member Functions

 MapWxpFile ()
 MapWxpFile (const char *filename)
 MapWxpFile (const char *filenamem, int raccess, int rtype)
 ~MapWxpFile ()
int checkType (const char *filename)
int open (const char *filenamem, int raccess, int rtype)
int open (const char *filename)
bool isOpen ()
int rewind ()
int seek (int off)
int tell ()
int close ()
bool isBinary ()
int readHeader (MapFileHeader &hdr)
int skipData ()
int readData (EarthPoint &ept)
int readData (EarthPoints &ept)
int writeHeader (MapFileHeader &hdr)
int writeData (EarthPoint &ept)
int print ()

Detailed Description

This class reads data from a WXP map file.

Author
Dan Vietor

Member Enumeration Documentation

◆ Type

Enumerator
UNK 

Unknown map type

BINARY 

Binary map type

ASCII 

ASCII map type

Constructor & Destructor Documentation

◆ MapWxpFile() [1/3]

MapWxpFile::MapWxpFile ( )

Constructor. Initializes values

◆ MapWxpFile() [2/3]

MapWxpFile::MapWxpFile ( const char * filename)

Constructor. Opens file.

Parameters
filenameFile to open

References open().

◆ MapWxpFile() [3/3]

MapWxpFile::MapWxpFile ( const char * filename,
int raccess,
int rtype )

Constructor. Opens the map database file

Parameters
filenameFile to open
raccessAccess (FileAttr::READ, FileAttr::WRITE)
rtypeFile type (BINARY, ASCII)

References open().

◆ ~MapWxpFile()

MapWxpFile::~MapWxpFile ( )

Destructor. Closes file

References close().

Member Function Documentation

◆ checkType()

int MapWxpFile::checkType ( const char * filename)

◆ close()

int MapWxpFile::close ( )

Closes the file and marks the class as closed

Referenced by ~MapWxpFile().

◆ isBinary()

bool WXP::MapWxpFile::isBinary ( )
inline

Returns true if map file binary

References BINARY.

◆ isOpen()

bool MapWxpFile::isOpen ( )

Returns true if file opened

◆ open() [1/2]

int MapWxpFile::open ( const char * filename)

Opens the map database file

Parameters
filenameFile to open

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

◆ open() [2/2]

int MapWxpFile::open ( const char * filename,
int raccess,
int rtype )

Opens the map database file

Parameters
filenameFile to open
raccessAccess (FileAttr::READ, FileAttr::WRITE)
rtypeFile type (BINARY, ASCII)

References BINARY, checkType(), WXP::StrLib::copy(), WXP::FileAttr::READ, UNK, and WXP::FileAttr::WRITE.

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

◆ print()

int MapWxpFile::print ( )

Prints object parameters

References BINARY.

◆ readData() [1/2]

int MapWxpFile::readData ( EarthPoint & ept)

Reads in the map data

Parameters
eptThe location of a map vertex

References ASCII, BINARY, WXP::EarthPoint::lat, and WXP::EarthPoint::lon.

◆ readData() [2/2]

int MapWxpFile::readData ( EarthPoints & ept)

Reads in the map data

Parameters
eptThe location of a map vertex

References WXP::EarthPoints::add(), ASCII, BINARY, and WXP::EarthPoints::init().

◆ readHeader()

int MapWxpFile::readHeader ( MapFileHeader & hdr)

◆ rewind()

int MapWxpFile::rewind ( )

Rewinds the file

◆ seek()

int MapWxpFile::seek ( int off)

Seeks to a point in the file

◆ skipData()

int MapWxpFile::skipData ( )

Skips the map data section (still need to read header)

References BINARY.

◆ tell()

int WXP::MapWxpFile::tell ( )
inline

Returns byte offset in map file

◆ writeData()

int MapWxpFile::writeData ( EarthPoint & ept)

Writes map data to file

Parameters
eptThe map vertex

References BINARY, WXP::EarthPoint::lat, and WXP::EarthPoint::lon.

◆ writeHeader()

int MapWxpFile::writeHeader ( MapFileHeader & hdr)

Write the map header for each block of points

Parameters
hdrHeader structure to put header data

References ASCII, WXP::MapFileHeader::index, WXP::MapFileHeader::maxlat, WXP::MapFileHeader::maxlon, WXP::MapFileHeader::minlat, WXP::MapFileHeader::minlon, and WXP::MapFileHeader::num.


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