Monero
Functions | Variables
utility.hpp File Reference
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <cstdint>
Include dependency graph for utility.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void outputHex (std::ostream &os, const char *data, int length)
 
char parseNibble (char hex)
 
void hex2bin (const char *in, int length, char *out)
 
constexpr bool stringsEqual (char const *a, char const *b)
 
template<size_t N>
bool equalsHex (const void *hash, const char(&hex)[N])
 
void dump (const char *buffer, uint64_t count, const char *name)
 
void readOption (const char *option, int argc, char **argv, bool &out)
 
void readIntOption (const char *option, int argc, char **argv, int &out, int defaultValue)
 
void readUInt64Option (const char *option, int argc, char **argv, uint64_t &out, uint64_t defaultValue)
 
void readFloatOption (const char *option, int argc, char **argv, double &out, double defaultValue)
 
void readInt (int argc, char **argv, int &out, int defaultValue)
 

Variables

constexpr char hexmap [] = "0123456789abcdef"
 

Function Documentation

◆ dump()

void dump ( const char *  buffer,
uint64_t  count,
const char *  name 
)
inline

◆ equalsHex()

template<size_t N>
bool equalsHex ( const void *  hash,
const char(&)  hex[N] 
)

◆ hex2bin()

void hex2bin ( const char *  in,
int  length,
char *  out 
)

◆ outputHex()

void outputHex ( std::ostream &  os,
const char *  data,
int  length 
)
inline

◆ parseNibble()

char parseNibble ( char  hex)

◆ readFloatOption()

void readFloatOption ( const char *  option,
int  argc,
char **  argv,
double &  out,
double  defaultValue 
)
inline

◆ readInt()

void readInt ( int  argc,
char **  argv,
int &  out,
int  defaultValue 
)
inline

◆ readIntOption()

void readIntOption ( const char *  option,
int  argc,
char **  argv,
int &  out,
int  defaultValue 
)
inline

◆ readOption()

void readOption ( const char *  option,
int  argc,
char **  argv,
bool out 
)
inline

◆ readUInt64Option()

void readUInt64Option ( const char *  option,
int  argc,
char **  argv,
uint64_t out,
uint64_t  defaultValue 
)
inline

◆ stringsEqual()

constexpr bool stringsEqual ( char const a,
char const b 
)

Variable Documentation

◆ hexmap

constexpr char hexmap[] = "0123456789abcdef"