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

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

#include "../include/MapFile.h"

Public Types

enum  Type { UNK , WXPMAP , KML , SHAPE }

Public Member Functions

 MapFile ()
 MapFile (const char *filename)
 MapFile (const char *filenamem, int raccess, int rtype)
 ~MapFile ()
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 writeHeader (MapFileHeader &hdr)
int writeData (EarthPoint &ept)
int print ()

Detailed Description

This class reads data from a map database file.

Author
Dan Vietor

Member Enumeration Documentation

◆ Type

Enumerator
UNK 

Unknown map type

WXPMAP 

WXP map type

KML 

KML map type

SHAPE 

Shape File map type

Constructor & Destructor Documentation

◆ MapFile() [1/3]

MapFile::MapFile ( )

Constructor. Initializes values

◆ MapFile() [2/3]

MapFile::MapFile ( const char * filename)

Constructor. Opens file.

Parameters
filenameFile to open

References open().

◆ MapFile() [3/3]

MapFile::MapFile ( 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().

◆ ~MapFile()

MapFile::~MapFile ( )

Destructor. Closes file

References close().

Member Function Documentation

◆ checkType()

int MapFile::checkType ( const char * filename)

◆ close()

int MapFile::close ( )

Closes the file and marks the class as closed

Referenced by ~MapFile().

◆ isBinary()

bool WXP::MapFile::isBinary ( )
inline

Returns true if map file binary

◆ isOpen()

bool MapFile::isOpen ( )

Returns true if file opened

Referenced by WXP::MapPlot::draw().

◆ open() [1/2]

int MapFile::open ( const char * filename)

Opens the map database file

Parameters
filenameFile to open

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

◆ open() [2/2]

int MapFile::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 WXP::MapWxpFile::BINARY, checkType(), KML, WXP::FileAttr::READ, SHAPE, UNK, WXP::MapWxpFile::UNK, and WXP::FileAttr::WRITE.

Referenced by WXP::MapPlot::draw(), MapFile(), MapFile(), and open().

◆ print()

int MapFile::print ( )

Prints object parameters

◆ readData()

int MapFile::readData ( EarthPoint & ept)

Reads in the map data

Parameters
eptThe location of a map vertex

References KML, SHAPE, and WXPMAP.

Referenced by WXP::MapPlot::draw().

◆ readHeader()

◆ rewind()

int MapFile::rewind ( )

Rewinds the file

◆ seek()

int MapFile::seek ( int off)

Seeks to a point in the file

◆ skipData()

int MapFile::skipData ( )

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

References WXPMAP.

◆ tell()

int WXP::MapFile::tell ( )
inline

Returns byte offset in map file

◆ writeData()

int MapFile::writeData ( EarthPoint & ept)

Writes map data to file

Parameters
eptThe map vertex

References WXPMAP.

◆ writeHeader()

int MapFile::writeHeader ( MapFileHeader & hdr)

Write the map header for each block of points

Parameters
hdrHeader structure to put header data

References WXPMAP.


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