to_hex and from_hex removed from API

This commit is contained in:
Luis Diaz Mas 2018-08-26 14:15:22 +02:00 committed by Luis Díaz Más
parent 22d9ab82a7
commit eefee8125b
2 changed files with 6 additions and 18 deletions

View File

@ -64,20 +64,6 @@ namespace Exiv2
*/
EXIV2API std::string getEnv(EnVar var);
/*!
@brief Convert an integer value to its hex character.
@param code The integer value.
@return the input's hex character.
*/
EXIV2API char to_hex(char code);
/*!
@brief Convert a hex character to its integer value.
@param ch The hex character.
@return the input's integer value.
*/
EXIV2API char from_hex(char ch);
/*!
@brief Encode the input url.
@param str The url needs encoding.

View File

@ -68,14 +68,16 @@ namespace Exiv2 {
return getenv(ENVARKEY[var]) ? getenv(ENVARKEY[var]) : ENVARDEF[var];
}
/// @brief Convert an integer value to its hex character.
char to_hex(char code) {
static char hex[] = "0123456789abcdef";
return hex[code & 15];
} // to_hex
}
/// @brief Convert a hex character to its integer value.
char from_hex(char ch) {
return isdigit(ch) ? ch - '0' : tolower(ch) - 'a' + 10;
} // from_hex
}
std::string urlencode(const char* str) {
const char* pstr = str;
@ -117,13 +119,13 @@ namespace Exiv2 {
}
*pbuf = '\0';
return buf;
} // urldecode
}
void urldecode(std::string& str) {
char* decodeStr = Exiv2::urldecode(str.c_str());
str = std::string(decodeStr);
free(decodeStr);
} // urldecode(const std::string& str)
}
int base64encode(const void* data_buf, size_t dataLength, char* result, size_t resultSize) {
const char base64chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";