insert has one progress
This commit is contained in:
@@ -22,6 +22,16 @@ MATADOR_UTILS_API std::string to_string(const blob_type_t &data);
|
||||
MATADOR_UTILS_API std::string to_string(const date_type_t &data);
|
||||
MATADOR_UTILS_API std::string to_string(const time_type_t &data);
|
||||
|
||||
template <typename IntegerType>
|
||||
std::string to_hex_string(IntegerType data, const size_t width = sizeof(IntegerType)<<1) {
|
||||
static auto digits = "0123456789ABCDEF";
|
||||
std::string result(width,'0');
|
||||
for (size_t i=0, j=(width-1)*4 ; i<width; ++i,j-=4) {
|
||||
result[i] = digits[(data>>j) & 0x0f];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits a string by a delimiter and
|
||||
* add the string tokens to a vector. The
|
||||
|
||||
Reference in New Issue
Block a user