MMDevice
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
CDeviceUtils Class Reference

#include <DeviceUtils.h>

Static Public Member Functions

static bool CopyLimitedString (char *pszTarget, const char *pszSource)
 
static unsigned GetMaxStringLength ()
 
static const char * ConvertToString (long lnVal)
 
static const char * ConvertToString (double dVal)
 
static const char * ConvertToString (int val)
 
static const char * ConvertToString (bool val)
 
static void Tokenize (const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=",")
 
static void SleepMs (long ms)
 
static void NapMicros (unsigned long microsecs)
 
static std::string HexRep (std::vector< unsigned char >)
 

Member Function Documentation

◆ ConvertToString() [1/4]

const char * CDeviceUtils::ConvertToString ( bool val)
static

Convert boolean value to string.

This function is not thread-safe, and the return value is only valid until the next call to ConvertToString().

◆ ConvertToString() [2/4]

const char * CDeviceUtils::ConvertToString ( double dVal)
static

Convert double value to string.

This function is not thread-safe, and the return value is only valid until the next call to ConvertToString().

◆ ConvertToString() [3/4]

const char * CDeviceUtils::ConvertToString ( int intVal)
static

Convert int value to string.

This function is not thread-safe, and the return value is only valid until the next call to ConvertToString().

◆ ConvertToString() [4/4]

const char * CDeviceUtils::ConvertToString ( long lnVal)
static

Convert long value to string.

This function is not thread-safe, and the return value is only valid until the next call to ConvertToString().

◆ CopyLimitedString()

bool CDeviceUtils::CopyLimitedString ( char * dest,
const char * src )
static

Copies string up to MM::MaxStrLength - 1 characters, truncating if necessary and ensuring the result is null-terminated.

Behavior is undefined unless dest points to a buffer with size at least MM::MaxStrLength and src points to a null-terminated string.

◆ GetMaxStringLength()

unsigned CDeviceUtils::GetMaxStringLength ( )
static

Programmatic access to the system-wide string size limit.

◆ HexRep()

std::string CDeviceUtils::HexRep ( std::vector< unsigned char > values)
static

◆ NapMicros()

void CDeviceUtils::NapMicros ( unsigned long period)
static

Yield to other threads for the specified interval in microseconds.

◆ SleepMs()

void CDeviceUtils::SleepMs ( long periodMs)
static

Block the current thread for the specified interval in milliseconds.

◆ Tokenize()

void CDeviceUtils::Tokenize ( const std::string & str,
std::vector< std::string > & tokens,
const std::string & delimiters = "," )
static

Parse the string and return an array of tokens.

Parameters
strinput string
tokensoutput array of tokens
delimitersa string containing a set of single-character token delimiters

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