GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
hex2num.cc File Reference
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "mach-info.h"
#include "ov.h"
#include "ovl.h"
#include "utils.h"
Include dependency graph for hex2num.cc:

Go to the source code of this file.

Functions

OCTAVE_EXPORT octave_value_list Fhex2num (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fnum2hex (const octave_value_list &args, int)
 
static uint8_t hex2nibble (unsigned char ch)
 
template<typename T >
Array< T > hex2num (const Array< std::string > &val, bool swap_bytes)
 
static void hex2num (const std::string &hex, void *num, size_t nbytes, bool swap_bytes)
 
static bool is_little_endian (bool is_float)
 
static unsigned char nibble2hex (unsigned char ch)
 
template<typename T >
Cell num2hex (const Array< T > &v, bool swap_bytes)
 
static void num2hex (const void *p, size_t n, char *hex, bool swap_bytes)
 

Function Documentation

◆ Fhex2num()

OCTAVE_EXPORT octave_value_list Fhex2num ( const octave_value_list args,
int   
)

Definition at line 157 of file hex2num.cc.

References error(), is_little_endian(), octave_value(), print_usage(), retval, and swap_bytes().

◆ Fnum2hex()

◆ hex2nibble()

static uint8_t hex2nibble ( unsigned char  ch)
static

Definition at line 47 of file hex2num.cc.

References error().

Referenced by hex2num().

◆ hex2num() [1/2]

template<typename T >
Array<T> hex2num ( const Array< std::string > &  val,
bool  swap_bytes 
)

◆ hex2num() [2/2]

static void hex2num ( const std::string &  hex,
void *  num,
size_t  nbytes,
bool  swap_bytes 
)
static

Definition at line 65 of file hex2num.cc.

References error(), hex2nibble(), and swap_bytes().

Referenced by hex2num().

◆ is_little_endian()

static bool is_little_endian ( bool  is_float)
inlinestatic

◆ nibble2hex()

static unsigned char nibble2hex ( unsigned char  ch)
inlinestatic

Definition at line 215 of file hex2num.cc.

Referenced by num2hex().

◆ num2hex() [1/2]

template<typename T >
Cell num2hex ( const Array< T > &  v,
bool  swap_bytes 
)

◆ num2hex() [2/2]

static void num2hex ( const void *  p,
size_t  n,
char *  hex,
bool  swap_bytes 
)
inlinestatic

Definition at line 226 of file hex2num.cc.

References n, nibble2hex(), and swap_bytes().

Referenced by Fnum2hex(), and num2hex().