|
WXP C++ Library Version 6.74.9
|
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 () |
This class reads data from a WXP map file.
| MapWxpFile::MapWxpFile | ( | ) |
Constructor. Initializes values
| MapWxpFile::MapWxpFile | ( | const char * | filename | ) |
| MapWxpFile::MapWxpFile | ( | const char * | filename, |
| int | raccess, | ||
| int | rtype ) |
Constructor. Opens the map database file
| filename | File to open |
| raccess | Access (FileAttr::READ, FileAttr::WRITE) |
| rtype | File type (BINARY, ASCII) |
References open().
| MapWxpFile::~MapWxpFile | ( | ) |
Destructor. Closes file
References close().
| int MapWxpFile::checkType | ( | const char * | filename | ) |
Checks the type of data in the file
| filename | File to check |
References ASCII, BINARY, WXP::MapFileHeader::index, WXP::MapFileHeader::maxlat, WXP::MapFileHeader::maxlon, WXP::MapFileHeader::minlat, WXP::MapFileHeader::minlon, and WXP::MapFileHeader::num.
Referenced by open().
| int MapWxpFile::close | ( | ) |
Closes the file and marks the class as closed
Referenced by ~MapWxpFile().
|
inline |
Returns true if map file binary
References BINARY.
| bool MapWxpFile::isOpen | ( | ) |
Returns true if file opened
| int MapWxpFile::open | ( | const char * | filename | ) |
Opens the map database file
| filename | File to open |
References open(), WXP::FileAttr::READ, and UNK.
| int MapWxpFile::open | ( | const char * | filename, |
| int | raccess, | ||
| int | rtype ) |
Opens the map database file
| filename | File to open |
| raccess | Access (FileAttr::READ, FileAttr::WRITE) |
| rtype | File type (BINARY, ASCII) |
References BINARY, checkType(), WXP::StrLib::copy(), WXP::FileAttr::READ, UNK, and WXP::FileAttr::WRITE.
Referenced by MapWxpFile(), MapWxpFile(), and open().
| int MapWxpFile::print | ( | ) |
Prints object parameters
References BINARY.
| int MapWxpFile::readData | ( | EarthPoint & | ept | ) |
Reads in the map data
| ept | The location of a map vertex |
References ASCII, BINARY, WXP::EarthPoint::lat, and WXP::EarthPoint::lon.
| int MapWxpFile::readData | ( | EarthPoints & | ept | ) |
Reads in the map data
| ept | The location of a map vertex |
References WXP::EarthPoints::add(), ASCII, BINARY, and WXP::EarthPoints::init().
| int MapWxpFile::readHeader | ( | MapFileHeader & | hdr | ) |
Reads the map header for each block of points
| hdr | Header structure to put header data |
References ASCII, BINARY, WXP::MapFileHeader::index, WXP::MapFileHeader::init(), WXP::MapFileHeader::maxlat, WXP::MapFileHeader::maxlon, WXP::MapFileHeader::minlat, WXP::MapFileHeader::minlon, WXP::MapFileHeader::num, WXP::FileAttr::READ, and WXP::MapFileHeader::setLabel().
| int MapWxpFile::rewind | ( | ) |
Rewinds the file
| int MapWxpFile::seek | ( | int | off | ) |
Seeks to a point in the file
| int MapWxpFile::skipData | ( | ) |
Skips the map data section (still need to read header)
References BINARY.
|
inline |
Returns byte offset in map file
| int MapWxpFile::writeData | ( | EarthPoint & | ept | ) |
Writes map data to file
| ept | The map vertex |
References BINARY, WXP::EarthPoint::lat, and WXP::EarthPoint::lon.
| int MapWxpFile::writeHeader | ( | MapFileHeader & | hdr | ) |
Write the map header for each block of points
| hdr | Header 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.