EUDAQ
 All Classes Namespaces Files Functions Variables Pages
Classes | Namespaces | Functions
Utils.hh File Reference
#include <string>
#include <vector>
#include <sstream>
#include <iomanip>
#include <stdexcept>
#include <fstream>
#include <sys/types.h>
#include "eudaq/Platform.hh"
#include <cstdint>

Go to the source code of this file.

Classes

struct  eudaq::Holder< T >
 
struct  eudaq::hexdec_t< T >
 

Namespaces

 eudaq
 

Functions

std::string DLLEXPORT eudaq::ucase (const std::string &)
 
std::string DLLEXPORT eudaq::lcase (const std::string &)
 
std::string DLLEXPORT eudaq::trim (const std::string &s)
 
std::string DLLEXPORT eudaq::firstline (const std::string &s)
 
std::string DLLEXPORT eudaq::escape (const std::string &)
 
std::vector< std::string >
DLLEXPORT 
eudaq::split (const std::string &str, const std::string &delim="\t")
 
std::vector< std::string >
DLLEXPORT 
eudaq::split (const std::string &str, const std::string &delim, bool dotrim)
 
void DLLEXPORT eudaq::bool2uchar (const bool *inBegin, const bool *inEnd, std::vector< unsigned char > &out)
 
void DLLEXPORT eudaq::uchar2bool (const unsigned char *inBegin, const unsigned char *inEnd, std::vector< bool > &out)
 
void DLLEXPORT eudaq::mSleep (unsigned ms)
 
template<typename T >
std::string eudaq::to_string (const T &x, int digits=0)
 
template<typename T >
std::string eudaq::to_string (const std::vector< T > &x, const std::string &sep, int digits=0)
 
template<typename T >
std::string eudaq::to_string (const std::vector< T > &x, int digits=0)
 
std::string eudaq::to_string (const std::string &x, int=0)
 
std::string eudaq::to_string (const char *x, int=0)
 
template<typename T >
std::string eudaq::to_hex (const T &x, int digits=0)
 
template<>
std::string eudaq::to_hex (const unsigned char &x, int digits)
 
template<>
std::string eudaq::to_hex (const signed char &x, int digits)
 
template<>
std::string eudaq::to_hex (const char &x, int digits)
 
template<typename T >
T DLLEXPORT eudaq::from_string (const std::string &x, const T &def=0)
 
template<>
std::string DLLEXPORT eudaq::from_string (const std::string &x, const std::string &def)
 
template<>
int64_t DLLEXPORT eudaq::from_string (const std::string &x, const int64_t &def)
 
template<>
uint64_t DLLEXPORT eudaq::from_string (const std::string &x, const uint64_t &def)
 
template<>
int32_t DLLEXPORT eudaq::from_string (const std::string &x, const int32_t &def)
 
template<>
uint32_t eudaq::from_string (const std::string &x, const uint32_t &def)
 
template<typename T >
hexdec_t< T > eudaq::hexdec (T val, unsigned hexdigits=hexdec_t< T >::DIGITS)
 
template<typename T >
std::ostream & eudaq::operator<< (std::ostream &os, const hexdec_t< T > &h)
 
template<>
std::ostream & eudaq::operator<< (std::ostream &os, const hexdec_t< unsigned char > &h)
 
template<>
std::ostream & eudaq::operator<< (std::ostream &os, const hexdec_t< signed char > &h)
 
template<>
std::ostream & eudaq::operator<< (std::ostream &os, const hexdec_t< char > &h)
 
template<typename T >
unsigned char * eudaq::uchar_cast (T *x)
 
template<typename T >
unsigned char * eudaq::uchar_cast (std::vector< T > &x)
 
template<typename T >
const unsigned char * eudaq::constuchar_cast (const T *x)
 
template<typename T >
const unsigned char * eudaq::constuchar_cast (const std::vector< T > &x)
 
template<typename T >
eudaq::getbigendian (const unsigned char *ptr)
 
template<typename T >
eudaq::getlittleendian (const unsigned char *ptr)
 
template<typename T >
void eudaq::setbigendian (unsigned char *ptr, const T &val)
 
template<typename T >
void eudaq::setlittleendian (unsigned char *ptr, const T &val)
 
std::string DLLEXPORT eudaq::ReadLineFromFile (const std::string &fname)
 
template<typename T >
eudaq::ReadFromFile (const std::string &fname, const T &def=0)
 
void DLLEXPORT eudaq::WriteStringToFile (const std::string &fname, const std::string &val)
 
template<typename T >
void eudaq::WriteToFile (const std::string &fname, const T &val)
 

Detailed Description

Contains generally useful utility functions.