Wasatch.VCPP 1.0.19
Visual C++ driver for Wasatch Photonics spectrometers
Static Public Member Functions | List of all members
WasatchVCPP::Util Class Reference

Internal class providing static utility functions for strings and whatnot. More...

#include <Util.h>

Static Public Member Functions

static std::string sprintf (const char *fmt,...)
 
static std::string toHex (const std::vector< uint8_t > &data)
 
static std::string toHex (const uint8_t *data, int len)
 
static std::string toLower (const std::string &s)
 
static std::string timestamp ()
 includes milliseconds on Windows
 
static void sleepMS (int ms)
 
template<typename T >
static std::string join (const T &values, const char *fmt, const char *delim=", ")
 Joins an iterable containter to a delimited string. More...
 

Detailed Description

Internal class providing static utility functions for strings and whatnot.

Some of these methods are defined to wrap platform-specific implementation.

Member Function Documentation

◆ join()

template<typename T >
static std::string WasatchVCPP::Util::join ( const T &  values,
const char *  fmt,
const char *  delim = ", " 
)
inlinestatic

Joins an iterable containter to a delimited string.

Parameters
values(Input) some STL collection (e.g. a set<int> or vector<double>)
fmt(Input) printf-style format code for collection elements (e.g. "%d" or "%.2f")
delim(Input) delimiter (i.e. ", " [default])
Returns
string("1, 2, 3") or string("1.11, 2.22, 3.33") etc

The documentation for this class was generated from the following files: