Convert a HadroZoo data type to its text name and return as const char* Pointer to datytype description as cstr
| Return Type | Function name | Arguments |
|---|---|---|
| const char* | Basetype2Txt | (hdbBasetype,) |
Declared in file: hzDatabase.h
Defined in file : hzTypes.cpp
Function Logic:
Function body:
const char* Basetype2Txt (hdbBasetype dtype)
{
// Category: Diagnostics
//
// Convert a HadroZoo data type to its text name and return as const char*
//
// Arguments: 1) dtype HadronZoo or standard C++ datatype
//
// Returns: Pointer to datytype description as cstr
static const hzString _typstrUKN = "BASETYPE_NOT_DEFINED" ; // used to indicate illegal type mix
// Group 1: Fundamental C++ types (fixed size)
static const hzString _typstrCPP_UKN = "BASETYPE_CPP_UNDEF" ; // Group 1 undefined
static const hzString _typstrDBL = "BASETYPE_DOUBLE" ; // 64 bit floating point value
static const hzString _typstrI64 = "BASETYPE_INT64" ; // 64 bit Signed Integer
static const hzString _typstrI32 = "BASETYPE_INT32" ; // 32 bit Signed Integer
static const hzString _typstrI16 = "BASETYPE_INT16" ; // 16 bit Signed Integer
static const hzString _typstrBYTE = "BASETYPE_BYTE" ; // 8 bit Signed Integer
static const hzString _typstrU64 = "BASETYPE_UINT64" ; // 64 bit unsigned Integer
static const hzString _typstrU32 = "BASETYPE_UINT32" ; // 32 bit unsigned Integer
static const hzString _typstrU16 = "BASETYPE_UINT16" ; // 16 bit unsigned Integer
static const hzString _typstrUBYTE = "BASETYPE_UBYTE" ; // 8 bit unsigned Integer
static const hzString _typstrBOOL = "BASETYPE_BOOL" ; // either true or false
// Group 2: HadronZoo Defined types (fixed size)
static const hzString _typstrHZO_UKN = "BASETYPE_HZO_UNDEF" ; // Group 2 undefined
static const hzString _typstrEMA = "BASETYPE_EMADDR" ; // Email Address
static const hzString _typstrURL = "BASETYPE_URL" ; // URL (Web address)
static const hzString _typstrIPA = "BASETYPE_IPADDR" ; // IP Address
static const hzString _typstrTIME = "BASETYPE_TIME" ; // No of seconds since midnight (4 bytes)
static const hzString _typstrSDATE = "BASETYPE_SDATE" ; // No of days since Jan 1st year 0000
static const hzString _typstrXDATE = "BASETYPE_XDATE" ; // Full date & time
static const hzString _typstrSTR = "BASETYPE_STRING" ; // Variable length string (hzString class), treated as a single value
static const hzString _typstrTEXT = "BASETYPE_TEXT" ; // Variable length string (hzString class), treated as a series of words
static const hzString _typstrBINARY = "BASETYPE_BINARY" ; // Document or file (possible text source)
static const hzString _typstrTXTDOC = "BASETYPE_TXTDOC" ; // Document or file (possible text source)
// Group 3: Application defined data enumerations
static const hzString _typstrENUM = "BASETYPE_ENUM" ; // String enumeration set
// Group 4: Application defined special text types
static const hzString _typstrAPPDEF = "BASETYPE_APPDEF" ; // String enumeration set
// Group 5: Application defined data class
static const hzString _typstrCLASS = "BASETYPE_CLASS" ; // String enumeration set
switch (dtype)
{
case BASETYPE_CPP_UNDEF: return *_typstrCPP_UKN ;
case BASETYPE_DOUBLE: return *_typstrDBL ;
case BASETYPE_INT64: return *_typstrI64 ;
case BASETYPE_INT32: return *_typstrI32 ;
case BASETYPE_INT16: return *_typstrI16 ;
case BASETYPE_BYTE: return *_typstrBYTE ;
case BASETYPE_UINT64: return *_typstrU64 ;
case BASETYPE_UINT32: return *_typstrU32 ;
case BASETYPE_UINT16: return *_typstrU16 ;
case BASETYPE_UBYTE: return *_typstrUBYTE ;
case BASETYPE_BOOL: return *_typstrBOOL ;
case BASETYPE_HZO_UNDEF: return *_typstrHZO_UKN ;
case BASETYPE_EMADDR: return *_typstrEMA ;
case BASETYPE_URL: return *_typstrURL ;
case BASETYPE_IPADDR: return *_typstrIPA ;
case BASETYPE_TIME: return *_typstrTIME ;
case BASETYPE_SDATE: return *_typstrSDATE ;
case BASETYPE_XDATE: return *_typstrXDATE ;
case BASETYPE_STRING: return *_typstrSTR ;
case BASETYPE_TEXT: return *_typstrTEXT ;
case BASETYPE_BINARY: return *_typstrBINARY ;
case BASETYPE_TXTDOC: return *_typstrTXTDOC ;
case BASETYPE_ENUM: return *_typstrENUM ;
case BASETYPE_APPDEF: return *_typstrAPPDEF ;
case BASETYPE_CLASS: return *_typstrCLASS ;
}
return *_typstrUKN ;
}