8 #define WIN32_LEAN_AND_MEAN
13 bool ParseBool(
const char* str);
14 int ParseNumberInt(
const char* str);
15 double ParseNumberDouble(
const char* str);
19 std::string GetUserProfile();
20 void GetFullPathName(
const char* rpstr,
char* &ret_buff,
int buffLen);
21 void GetFullPathName(
const char* relativePathName,
const char* initPath,
22 char* &ret_buff,
int buffLen);
23 std::string GetFullPathName(std::string relativePathName, std::string initPath);
28 void StringToLower (std::string &str);
29 void StringToUpper (std::string &str);
32 void __declspec(dllexport) smessage(std::string msg);
57 void ResizeContainer (std::vector<T>& vec,
size_t size,
bool zeroIfNotResized =
false)
60 if (vec.size() != size)
65 else if (zeroIfNotResized)
68 std::fill(vec.begin(), vec.end(), T());
80 return (num > 0.0) ? floor(num + 0.5) : ceil(num - 0.5);
86 template <
typename DstType,
typename SrcType>
87 inline bool IsType(
const SrcType* src)
89 return dynamic_cast<const DstType*
>(src) != 0;
96 inline bool Contains(std::vector<T, std::allocator<T> > vec, T item)
98 for (
int i = 0; i < vec.size(); i++)
101 if (old == item) {
return true; }
112 std::stringstream stream;
123 template <
typename T>
124 inline bool FromString(T& t,
const std::string& s, std::ios_base& (*f)(std::ios_base&) = std::dec)
126 std::istringstream iss(s);
127 return !(iss >> f >> t).fail();
T Round(T num)
round value
Definition: Helper.h:78
std::string GetFilledDigits(int number, size_t totalDigits)
Gets the string prefixed with zeros so the string is a certain length.
Definition: Helper.cpp:61
bool Contains(std::vector< T, std::allocator< T > > vec, T item)
Definition: Helper.h:96
bool IsType(const SrcType *src)
Definition: Helper.h:87
std::string NumToString(T val)
Definition: Helper.h:110
bool FromString(T &t, const std::string &s, std::ios_base &(*f)(std::ios_base &)=std::dec)
save the array to file
Definition: Helper.h:124
void __declspec(dllexport) smessage(std void SafeDelete(T *&pVal)
messaging
Definition: Helper.h:39
void SafeDeleteArray(T *&pVal)
Safely delete memory that was allocated with new[].
Definition: Helper.h:50
__declspec(dllexport) IWPOCTCamera *GetOCTCamera(IWPOCTCamera __declspec(dllexport) IWPOCTCamera __declspec(dllexport) bool DestroyOCTCamera(IWPOCTCamera *camera
Gets the instance of the camera object.
Definition: IWPOCTController.cpp:29