OmniSciDB  b28c0d5765
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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

constexpr HexDigitToDecimalTable hex_digit_to_decimal_table
 

Function Documentation

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

Definition at line 1029 of file Types.cpp.

References hex_to_binary().

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

1029  {
1030  auto num_bytes = wkb_hex.size() >> 1;
1031  std::vector<uint8_t> wkb(num_bytes);
1032  auto* chars = wkb_hex.data();
1033  auto* bytes = wkb.data();
1034  for (size_t i = 0; i < num_bytes; i++) {
1035  auto const& usb = *chars++;
1036  auto const& lsb = *chars++;
1037  *bytes++ = hex_to_binary(usb, lsb);
1038  }
1039  return wkb;
1040 }
uint8_t hex_to_binary(const char &usb, const char &lsb)
Definition: Types.cpp:1025

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1025 of file Types.cpp.

Referenced by hex_string_to_binary_vector().

1025  {
1026  return (hex_digit_to_decimal_table[usb] << 4) | hex_digit_to_decimal_table[lsb];
1027 }
constexpr HexDigitToDecimalTable hex_digit_to_decimal_table
Definition: Types.cpp:1023

+ Here is the caller graph for this function:

Variable Documentation

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

Definition at line 1023 of file Types.cpp.