MMDevice
Loading...
Searching...
No Matches
DeviceUtils.h
Go to the documentation of this file.
1
2// FILE: DeviceUtils.h
3// PROJECT: Micro-Manager
4// SUBSYSTEM: MMDevice - Device adapter kit
5//-----------------------------------------------------------------------------
6// DESCRIPTION: Class with utility methods for building device adapters
7// AUTHOR: Nenad Amodaj, nenad@amodaj.com 06/08/2005
8// COPYRIGHT: University of California, San Francisco, 2006
9// LICENSE: This file is distributed under the BSD license.
10// License text is included with the source distribution.
11//
12// This file is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty
14// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15//
16// IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
18// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.
19//
20
21#pragma once
22
23#include "MMDeviceConstants.h"
24#include <vector>
25#include <string>
26
28{
29public:
30 static bool CopyLimitedString(char* pszTarget, const char* pszSource);
31 static unsigned GetMaxStringLength();
32 static const char* ConvertToString(long lnVal);
33 static const char* ConvertToString(double dVal);
34 static const char* ConvertToString(int val);
35 static const char* ConvertToString(bool val);
36 static void Tokenize(const std::string& str, std::vector<std::string>& tokens, const std::string& delimiters = ",");
37 static void SleepMs(long ms);
38 static void NapMicros(unsigned long microsecs);
39 static std::string HexRep(std::vector<unsigned char> );
40private:
41 static char m_pszBuffer[MM::MaxStrLength];
42};
Definition DeviceUtils.h:28
static const char * ConvertToString(long lnVal)
Definition DeviceUtils.cpp:63
static void Tokenize(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=",")
Definition DeviceUtils.cpp:129
static std::string HexRep(std::vector< unsigned char >)
Definition DeviceUtils.cpp:106
static bool CopyLimitedString(char *pszTarget, const char *pszSource)
Definition DeviceUtils.cpp:43
static unsigned GetMaxStringLength()
Definition DeviceUtils.cpp:52
static void SleepMs(long ms)
Definition DeviceUtils.cpp:150
static void NapMicros(unsigned long microsecs)
Definition DeviceUtils.cpp:162
const int MaxStrLength
Definition MMDeviceConstants.h:96