OmniSciDB  2e3a973ef4
Geospatial::anonymous_namespace{Types.cpp} Namespace Reference

Classes

struct  HexDigitToDecimalTable
 

Functions

uint8_t hex_to_binary (const char &usb, const char &lsb)
 
std::vector< uint8_t > hex_string_to_binary_vector (const std::string &wkb_hex)
 

Variables

struct Geospatial::anonymous_namespace{Types.cpp}::HexDigitToDecimalTable hex_digit_to_decimal_table
 

Function Documentation

◆ hex_string_to_binary_vector()

std::vector<uint8_t> Geospatial::anonymous_namespace{Types.cpp}::hex_string_to_binary_vector ( const std::string &  wkb_hex)

Definition at line 652 of file Types.cpp.

References hex_to_binary().

Referenced by Geospatial::GeoTypesFactory::createOGRGeometry().

652  {
653  auto num_bytes = wkb_hex.size() >> 1;
654  std::vector<uint8_t> wkb(num_bytes);
655  auto* chars = wkb_hex.data();
656  auto* bytes = wkb.data();
657  for (size_t i = 0; i < num_bytes; i++) {
658  auto const& usb = *chars++;
659  auto const& lsb = *chars++;
660  *bytes++ = hex_to_binary(usb, lsb);
661  }
662  return wkb;
663 }
uint8_t hex_to_binary(const char &usb, const char &lsb)
Definition: Types.cpp:648
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hex_to_binary()

uint8_t Geospatial::anonymous_namespace{Types.cpp}::hex_to_binary ( const char &  usb,
const char &  lsb 
)
inline

Definition at line 648 of file Types.cpp.

Referenced by hex_string_to_binary_vector().

648  {
649  return (hex_digit_to_decimal_table[usb] << 4) | hex_digit_to_decimal_table[lsb];
650 }
struct Geospatial::anonymous_namespace{Types.cpp}::HexDigitToDecimalTable hex_digit_to_decimal_table
+ Here is the caller graph for this function:

Variable Documentation

◆ hex_digit_to_decimal_table

struct Geospatial::anonymous_namespace{Types.cpp}::HexDigitToDecimalTable Geospatial::anonymous_namespace{Types.cpp}::hex_digit_to_decimal_table