MMDevice  70
Static Public Member Functions | List of all members
CDeviceUtils Class Reference

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().

References 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().

Referenced by ConvertToString(), CStateDeviceBase< U >::OnStateChanged(), and CStateDeviceBase< U >::SetPosition().

◆ 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.

Referenced by CCameraBase< U >::GetChannelName(), CCameraBase< U >::GetComponentName(), CDeviceBase< T, U >::GetDescription(), CDeviceBase< T, U >::GetErrorText(), CDeviceBase< T, U >::GetLabel(), CDeviceBase< T, U >::GetModuleName(), CStateDeviceBase< U >::GetPositionLabel(), CDeviceBase< T, U >::GetProperty(), CDeviceBase< T, U >::GetPropertyName(), and CDeviceBase< T, U >::GetPropertyValueAt().

◆ GetMaxStringLength()

unsigned CDeviceUtils::GetMaxStringLength ( )
static

Programmatic access to the system-wide string size limit.

◆ 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
str- input string
tokens- output array of tokens
delimiters- a string containing a set of single-character token delimiters

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