GlsMap Toolkit  1.3.1
disti::VPFUtil Class Reference

#include <vpf_util.h>

Classes

struct  Coord2DLong
 
struct  Coord2DShort
 
struct  Coord3DLong
 
struct  Coord3DShort
 
struct  DateTime
 
class  FilePath
 
class  PointerArray
 
struct  Triplet
 

Public Types

enum  { FACC_CODE_LENGTH = 5u }
 
enum  EndianMode { ENDIAN_MODE_LITTLE, ENDIAN_MODE_BIG }
 
enum  DataType {
  DATA_TYPE_TEXT, DATA_TYPE_TEXT_LATIN, DATA_TYPE_TEXT_FULL_LATIN, DATA_TYPE_TEXT_MULTILINGUAL,
  DATA_TYPE_SHORT_FLOAT, DATA_TYPE_LONG_FLOAT, DATA_TYPE_SHORT_INTEGER, DATA_TYPE_LONG_INTEGER,
  DATA_TYPE_2D_COORD_SHORT, DATA_TYPE_2D_COORD_LONG, DATA_TYPE_3D_COORD_SHORT, DATA_TYPE_3D_COORD_LONG,
  DATA_TYPE_DATE_TIME, DATA_TYPE_NULL, DATA_TYPE_TRIPLET
}
 
enum  KeyType { KEY_TYPE_PRIMARY, KEY_TYPE_UNIQUE, KEY_TYPE_NON_UNIQUE }
 
enum  FeatureType {
  FEATURE_TYPE_POINT, FEATURE_TYPE_LINE, FEATURE_TYPE_AREA, FEATURE_TYPE_TEXT,
  FEATURE_TYPE_COMPLEX
}
 
enum  SecurityClass {
  SECURITY_CLASS_TOP_SECRET, SECURITY_CLASS_SECRET, SECURITY_CLASS_CONFIDENTIAL, SECURITY_CLASS_RESTRICTED,
  SECURITY_CLASS_UNCLASSIFIED
}
 
typedef float Float32
 
typedef double Float64
 
typedef unsigned short UInt16
 
typedef unsigned int UInt32
 
typedef bool WarningBool
 

Static Public Member Functions

static UInt32 DecodeUInt16 (const unsigned char *const intData, const EndianMode srcMode)
 
static UInt32 DecodeUInt32 (const unsigned char *const intData, const EndianMode srcMode)
 
static Float32 DecodeFloat32 (const unsigned char *const floatData, const EndianMode srcMode)
 
static Float64 DecodeFloat64 (const unsigned char *const floatData, const EndianMode srcMode)
 
static bool IsFloat32NULL (const Float32 f)
 
static bool IsFloat64NULL (const Float64 f)
 
static bool IsUInt16NULL (const UInt16 i)
 
static bool IsUInt32NULL (const UInt32 i)
 
static bool IsTextNULL (const char *const txt)
 
static void KillTrailingWS (char *const src)
 
static bool StricmpWS (const char *const s1, const char *const s2)
 
static bool FileExists (const char *const fname)
 
static bool DecodeFeatureType (const char featTypeChar, FeatureType &featType)
 
static bool DecodeSecurityClass (const char securityClassChar, SecurityClass &securityClass)
 

Static Public Attributes

static const char *const DHT_NAME = "dht"
 
static const char *const LAT_NAME = "lat"
 
static const char *const BROWSE_LIB_NAME = "browse"
 
static const char *const LHT_NAME = "lht"
 
static const char *const GRT_NAME = "grt"
 
static const char *const CAT_NAME = "cat"
 
static const char *const FCS_NAME = "fcs"
 
static const char *const FCA_NAME = "fca"
 
static const char *const NRAT_NAME = "notes.rat"
 
static const char *const CVDT_NAME = "char.vdt"
 
static const char *const IVDT_NAME = "int.vdt"
 
static const char *const CND_NAME = "cnd"
 
static const char *const END_NAME = "end"
 
static const char *const EDG_NAME = "edg"
 
static const char *const FAC_NAME = "fac"
 
static const char *const TXT_NAME = "txt"
 
static const char *const RNG_NAME = "rng"
 
static const char *const EBR_NAME = "ebr"
 
static const char *const FBR_NAME = "fbr"
 
static const char *const TILEREF_COV_NAME = "tileref"
 
static const char *const LIBREF_COV_NAME = "libref"
 
static const char *const LIB_COV_NAME = "lib"
 
static const char *const TILEREF_AFT_NAME = "tileref.aft"
 
static const char *const LIBREF_LFT_NAME = "libref.lft"
 
static const char *const POINT_FEATURE_EXT = ".pft"
 
static const char *const LINE_FEATURE_EXT = ".lft"
 
static const char *const AREA_FEATURE_EXT = ".aft"
 
static const char *const TEXT_FEATURE_EXT = ".tft"
 
static const char *const LINE_FEATURE_JOIN_EXT = ".ljt"
 
static const char *const AREA_FEATURE_JOIN_EXT = ".ajt"
 
static const char *const COMPLEX_FEATURE_EXT = ".cft"
 
static const char *const ID_COLUMN_NAME = "id"
 
static const char *const TILE_ID_COLUMN_NAME = "tile_id"
 
static const char *const END_ID_COLUMN_NAME = "end_id"
 
static const char *const RIGHT_FACE_COLUMN_NAME = "right_face"
 
static const char *const LEFT_FACE_COLUMN_NAME = "left_face"
 
static const char *const RIGHT_EDGE_COLUMN_NAME = "right_edge"
 
static const char *const LEFT_EDGE_COLUMN_NAME = "left_edge"
 
static const char *const EDGE_ID_COLUMN_NAME = "edg_id"
 
static const char *const TEXT_ID_COLUMN_NAME = "txt_id"
 
static const char *const FACC_CODE_COLUMN_NAME = "f_code"
 

Protected Types

enum  { UINT16_NULL_VALUE = 0x8000u }
 
enum  { UINT32_NULL_VALUE = 0x80000000U }
 

Static Protected Member Functions

static void SwapTwo (const unsigned char *const src, unsigned char *const dst, const EndianMode srcMode)
 
static void SwapFour (const unsigned char *const src, unsigned char *const dst, const EndianMode srcMode)
 
static void SwapEight (const unsigned char *const src, unsigned char *const dst, const EndianMode srcMode)
 

Static Protected Attributes

static const EndianMode _targetEndianMode = ENDIAN_MODE_BIG
 

Detailed Description

collection of VPF related utility functions, types, and constants

Member Typedef Documentation

typedef float disti::VPFUtil::Float32

32-bit floating point

typedef double disti::VPFUtil::Float64

64-bit floating point

typedef unsigned short disti::VPFUtil::UInt16

16-bit VPF unsigned integer

typedef unsigned int disti::VPFUtil::UInt32

32-bit VPF unsigned integer

Member Enumeration Documentation

anonymous enum
protected

a NULL UInt32 value

anonymous enum
protected

a NULL UInt16 value

possible VPF data types

Enumerator
DATA_TYPE_TEXT 

text

DATA_TYPE_TEXT_LATIN 

text Level 1, Latin 1 - ISO 8859

DATA_TYPE_TEXT_FULL_LATIN 

text Level 2, Full Latin - ISO 6937

DATA_TYPE_TEXT_MULTILINGUAL 

text Level 3, Multilingual ISO 10646

DATA_TYPE_SHORT_FLOAT 

IEEE 784 single precision float 32-bits

DATA_TYPE_LONG_FLOAT 

IEEE 784 double precision float 64-bits

DATA_TYPE_SHORT_INTEGER 

16-bit integer

DATA_TYPE_LONG_INTEGER 

32-bit integer

DATA_TYPE_2D_COORD_SHORT 

2D coordinate of short float

DATA_TYPE_2D_COORD_LONG 

2D coordinate of long float

DATA_TYPE_3D_COORD_SHORT 

3D coordinate of short float

DATA_TYPE_3D_COORD_LONG 

3D coordinate of long float

DATA_TYPE_DATE_TIME 

Date and Time

DATA_TYPE_NULL 

NULL field

DATA_TYPE_TRIPLET 

Triplet ID

enum of byte ordering modes

possible VPF feature types

possible VPF table column key types

Enumerator
KEY_TYPE_PRIMARY 

primary key

KEY_TYPE_UNIQUE 

unique key

KEY_TYPE_NON_UNIQUE 

non unique key

security classifications

Member Function Documentation

bool VPFUtil::DecodeFeatureType ( const char  featTypeChar,
FeatureType featType 
)
static

Decode a feature type character indicator from a VPF table into a feature type

Parameters
featTypeCharfeature type character indicator
&featType[out] gets feature type on success
Returns
true on success else false
VPFUtil::Float32 VPFUtil::DecodeFloat32 ( const unsigned char *const  floatData,
const EndianMode  srcMode 
)
static

Construct a Float32 from four bytes of data read from a VPF file, correcting for source and target endian mode as needed.

Parameters
floatDatafour bytes of data
srcModeendian mode of floatData
Returns
Float32 value
VPFUtil::Float64 VPFUtil::DecodeFloat64 ( const unsigned char *const  floatData,
const EndianMode  srcMode 
)
static

Construct a Float64 from eight bytes of data read from a VPF file, correcting for source and target endian mode as needed.

Parameters
floatDataeight bytes of data
srcModeendian mode of floatData
Returns
Float64 value
bool VPFUtil::DecodeSecurityClass ( const char  securityClassChar,
SecurityClass securityClass 
)
static

Decode a security class character indicator from a VPF table into a security class

Parameters
securityClassCharsecurity class character indicator
&securityClass[out] gets security class on success
Returns
true on success else false
VPFUtil::UInt32 VPFUtil::DecodeUInt16 ( const unsigned char *const  intData,
const EndianMode  srcMode 
)
static

Construct an UInt16 from tow bytes of data read from a VPF file, correcting for source and target endian mode as needed.

Parameters
intDatatow bytes of data
srcModeendian mode of intData
Returns
UInt16 integer value
VPFUtil::UInt32 VPFUtil::DecodeUInt32 ( const unsigned char *const  intData,
const EndianMode  srcMode 
)
static

Construct an UInt32 from four bytes of data read from a VPF file, correcting for source and target endian mode as needed.

Parameters
intDatafour bytes of data
srcModeendian mode of intData
Returns
UInt32 integer value
bool VPFUtil::FileExists ( const char *const  fname)
static

Determine if a file exists

Parameters
fnamename of file
Returns
true if file exists else false
static bool disti::VPFUtil::IsFloat32NULL ( const Float32  f)
inlinestatic

Determine if the given Float32 is a NULL value

Parameters
fFloat32 in question
Returns
true if NULL else false
static bool disti::VPFUtil::IsFloat64NULL ( const Float64  f)
inlinestatic

Determine if the given Float64 is a NULL value

Parameters
fFloat64 in question
Returns
true if NULL else false
static bool disti::VPFUtil::IsTextNULL ( const char *const  txt)
inlinestatic

Determine if the given text value is a NULL value

Parameters
txttext in question
Returns
true if NULL text value else NULL
static bool disti::VPFUtil::IsUInt16NULL ( const UInt16  i)
inlinestatic

Determine if the given UInt16 is NULL value

Parameters
iUInt16 in question
Returns
true if NULL else false
static bool disti::VPFUtil::IsUInt32NULL ( const UInt32  i)
inlinestatic

Determine if the given UInt32 is NULL value

Parameters
iUInt32 in question
Returns
true if NULL else false
void VPFUtil::KillTrailingWS ( char *const  src)
static

Kill any trailing white space in the given string

Parameters
srcstring in question
bool VPFUtil::StricmpWS ( const char *const  s1,
const char *const  s2 
)
static

Perform a lower case comparison of the two strings, stopping at the first whitespace character

Parameters
s1first string to compare
s2second string to compare
Returns
true if strings match else false
void VPFUtil::SwapEight ( const unsigned char *const  src,
unsigned char *const  dst,
const EndianMode  srcMode 
)
staticprotected

Swap (reverse) the given eight byte buffer if its endian mode does not match the mode of the endian mode of the target architecture

Parameters
srcsource data to swap (must be at least 8 bytes long)
dst[out] receives potentially swapped data (must be at least 8 bytes long)
srcModeendian mode of source data
void VPFUtil::SwapFour ( const unsigned char *const  src,
unsigned char *const  dst,
const EndianMode  srcMode 
)
staticprotected

Swap (reverse) the given four byte buffer if its endian mode does not match the mode of the endian mode of the target architecture

Parameters
srcsource data to swap (must be at least 4 bytes long)
dst[out] receives potentially swapped data (must be at least 4 bytes long)
srcModeendian mode of source data
void VPFUtil::SwapTwo ( const unsigned char *const  src,
unsigned char *const  dst,
const EndianMode  srcMode 
)
staticprotected

Swap (reverse) the given two byte buffer if its endian mode does not match the mode of the endian mode of the target architecture

Parameters
srcsource data to swap (must be at least 2 bytes long)
dst[out] receives potentially swapped data (must be at least 2 bytes long)
srcModeendian mode of source data

Member Data Documentation

const VPFUtil::EndianMode VPFUtil::_targetEndianMode = ENDIAN_MODE_BIG
staticprotected

endian mode of target architecture

const char *const VPFUtil::AREA_FEATURE_EXT = ".aft"
static

file extension for an area feature table

const char *const VPFUtil::AREA_FEATURE_JOIN_EXT = ".ajt"
static

file extension for an area join table

const char *const VPFUtil::BROWSE_LIB_NAME = "browse"
static

name of browse library

const char *const VPFUtil::CAT_NAME = "cat"
static

name of coverage attribute table

const char *const VPFUtil::CND_NAME = "cnd"
static

name of connected node primitive table

const char *const VPFUtil::COMPLEX_FEATURE_EXT = ".cft"
static

file extension for a complex feature table

const char *const VPFUtil::CVDT_NAME = "char.vdt"
static

name of character value descriptor table

const char *const VPFUtil::DHT_NAME = "dht"
static

name of database header table

const char *const VPFUtil::EBR_NAME = "ebr"
static

name of edge bounding rectangle table

const char *const VPFUtil::EDG_NAME = "edg"
static

name of edge primitive table

const char *const VPFUtil::EDGE_ID_COLUMN_NAME = "edg_id"
static

name of edge ID column in a VPF table

const char *const VPFUtil::END_ID_COLUMN_NAME = "end_id"
static

name of entity node ID column in a VPF table

const char *const VPFUtil::END_NAME = "end"
static

name of entity node primitive table

const char *const VPFUtil::FAC_NAME = "fac"
static

name of face primitive table

const char *const VPFUtil::FACC_CODE_COLUMN_NAME = "f_code"
static

name of facc code column in a VPF table

const char *const VPFUtil::FBR_NAME = "fbr"
static

name of face bounding rectangle table

const char *const VPFUtil::FCA_NAME = "fca"
static

name of feature class attribute table

const char *const VPFUtil::FCS_NAME = "fcs"
static

name of feature class schema table

const char *const VPFUtil::GRT_NAME = "grt"
static

name of geographic reference table

const char *const VPFUtil::ID_COLUMN_NAME = "id"
static

name of ID column in any VPF table (always first column)

const char *const VPFUtil::IVDT_NAME = "int.vdt"
static

name of integer value descriptor table

const char *const VPFUtil::LAT_NAME = "lat"
static

name of library attribute table

const char *const VPFUtil::LEFT_EDGE_COLUMN_NAME = "left_edge"
static

name of left edge column in a VPF table

const char *const VPFUtil::LEFT_FACE_COLUMN_NAME = "left_face"
static

name of left face column in a VPF table

const char *const VPFUtil::LHT_NAME = "lht"
static

name of library header table

const char *const VPFUtil::LIB_COV_NAME = "lib"
static

name of the library coverage

const char *const VPFUtil::LIBREF_COV_NAME = "libref"
static

name of the libref coverage

const char *const VPFUtil::LIBREF_LFT_NAME = "libref.lft"
static

name of the libref line feature table

const char *const VPFUtil::LINE_FEATURE_EXT = ".lft"
static

file extension for a line feature table

const char *const VPFUtil::LINE_FEATURE_JOIN_EXT = ".ljt"
static

file extension for a line join table

const char *const VPFUtil::NRAT_NAME = "notes.rat"
static

name of notes related attribute table

const char *const VPFUtil::POINT_FEATURE_EXT = ".pft"
static

file extension for a point feature table

const char *const VPFUtil::RIGHT_EDGE_COLUMN_NAME = "right_edge"
static

name of right edge column in a VPF table

const char *const VPFUtil::RIGHT_FACE_COLUMN_NAME = "right_face"
static

name of right face column in a VPF table

const char *const VPFUtil::RNG_NAME = "rng"
static

name of ring table

const char *const VPFUtil::TEXT_FEATURE_EXT = ".tft"
static

file extension for a text feature table

const char *const VPFUtil::TEXT_ID_COLUMN_NAME = "txt_id"
static

name of text ID column in a VPF table

const char *const VPFUtil::TILE_ID_COLUMN_NAME = "tile_id"
static

name of tile ID column in a VPF table

const char *const VPFUtil::TILEREF_AFT_NAME = "tileref.aft"
static

name of the tileref area feature table

const char *const VPFUtil::TILEREF_COV_NAME = "tileref"
static

name of the tileref coverage

const char *const VPFUtil::TXT_NAME = "txt"
static

name of text primitive table


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