retdec
Namespaces
conversion.h File Reference

Conversion utilities. More...

#include <iomanip>
#include <ios>
#include <limits>
#include <sstream>
#include <string>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Namespaces

 retdec
 
 retdec::utils
 

Functions

Conversions
char * retdec::utils::byteToHexString (uint8_t b, bool uppercase=true)
 
template<typename N >
void retdec::utils::bytesToHexString (const N *data, std::size_t dataSize, std::string &result, std::size_t offset=0, std::size_t size=0, bool uppercase=true, bool spacing=false)
 
template<typename N >
void retdec::utils::bytesToHexString (const std::vector< N > &bytes, std::string &result, std::size_t offset=0, std::size_t size=0, bool uppercase=true, bool spacing=false)
 
template<typename I >
std::string retdec::utils::intToHexString (I w, bool addBase=false, unsigned fillToN=0)
 Converts the given integer into its hexadecimal representation. More...
 
std::vector< uint8_t > retdec::utils::hexStringToBytes (const std::string &hexIn)
 
template<typename N >
bool retdec::utils::strToNum (const std::string &str, N &number, std::ios_base &(*format)(std::ios_base &)=std::dec)
 Converts the given string into a number. More...
 
template<typename N >
std::string retdec::utils::bytesToBits (const N *data, std::size_t dataSize)
 Converts the given array of numbers into a bits. More...
 
template<typename N >
std::string retdec::utils::bytesToBits (const std::vector< N > &bytes)
 Converts the given vector of numbers into a bits. More...
 
template<typename N >
void retdec::utils::bytesToString (const N *data, std::size_t dataSize, std::string &result, std::size_t offset=0, std::size_t size=0)
 
template<typename N >
void retdec::utils::bytesToString (const std::vector< N > &bytes, std::string &result, std::size_t offset=0, std::size_t size=0)
 
void retdec::utils::double10ToDouble8 (std::vector< unsigned char > &dest, const std::vector< unsigned char > &src)
 Convert 80-bit (10-byte) long double binary data (byte array) into 64-bit (8-byte) double binary data. More...
 
unsigned short retdec::utils::byteSwap16 (unsigned short val)
 Swap bytes for Intel x86 16-bit little-endian immediate. More...
 
unsigned int retdec::utils::byteSwap32 (unsigned int val)
 Swap bytes for Intel x86 32-bit little-endian immediate. More...
 
std::string retdec::utils::byteSwap16 (const std::string &val)
 Swap bytes for Intel x86 16-bit little-endian immediate. More...
 
std::string retdec::utils::byteSwap32 (const std::string &val)
 Swap bytes for Intel x86 32-bit little-endian immediate. More...
 

Detailed Description

Conversion utilities.