OmniSciDB  8fa3bf436f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 858 of file Types.cpp.

References hex_to_binary(), and i.

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

858  {
859  auto num_bytes = wkb_hex.size() >> 1;
860  std::vector<uint8_t> wkb(num_bytes);
861  auto* chars = wkb_hex.data();
862  auto* bytes = wkb.data();
863  for (size_t i = 0; i < num_bytes; i++) {
864  auto const& usb = *chars++;
865  auto const& lsb = *chars++;
866  *bytes++ = hex_to_binary(usb, lsb);
867  }
868  return wkb;
869 }
uint8_t hex_to_binary(const char &usb, const char &lsb)
Definition: Types.cpp:854

+ 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 854 of file Types.cpp.

Referenced by hex_string_to_binary_vector().

854  {
855  return (hex_digit_to_decimal_table[usb] << 4) | hex_digit_to_decimal_table[lsb];
856 }
constexpr HexDigitToDecimalTable hex_digit_to_decimal_table
Definition: Types.cpp:852

+ 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 852 of file Types.cpp.