AnimatLab  2
Test
StdUtilFunctions.h File Reference

Declares the standard utility functions class. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 StdUtils
 Namespace for the standard utility objects.
 

Macros

#define FSTR(f, v)   Std_ToStr(f, v)
 
#define LOG_DB(m)
 
#define LOG_ERROR(m)   Std_LogMsg(StdLogError, m, __FILE__, __LINE__)
 
#define LOG_MSG(l, m)   Std_LogMsg(l, m, __FILE__, __LINE__)
 
#define NULL_STR(s)   Std_NullStr(s)
 
#define RELAY_ERROR(oError)   Std_RelayError(oError, __FILE__, __LINE__)
 
#define STD_LOG_DB_DSN   ""
 
#define STD_LOG_DB_PSWD   ""
 
#define STD_LOG_DB_USER   ""
 
#define STD_MAX   std::max
 
#define STD_MIN   std::min
 
#define STR(v)   Std_ToStr(v)
 
#define THROW_ERROR(lError, strError)   Std_ThrowError(lError, strError, __FILE__, __LINE__, "")
 
#define THROW_PARAM_ERROR(lError, strError, strValueName, Val)   Std_ThrowError(lError, strError, __FILE__, __LINE__, strValueName, Val)
 
#define THROW_TEXT_ERROR(lError, strError, strText)   Std_ThrowError(lError, strError, __FILE__, __LINE__, strText)
 
#define TRACE_DEBUG(m)
 
#define TRACE_DEBUG_NS(m)
 
#define TRACE_DETAIL(m)
 
#define TRACE_DETAIL_NS(m)
 
#define TRACE_INFO(m)
 
#define TRACE_INFO_NS(m)
 
#define V3_DIST(a, b)   sqrt( pow(a[0]-b[0], 2) + pow(a[1]-b[1], 2) + pow(a[2]-b[2], 2) )
 
#define V3_MAG(a)   sqrt( pow(a[0], 2) + pow(a[1], 2) + pow(a[2], 2) )
 
#define V4_DIST(a, b)   sqrt( pow(a[0]-b[0], 2) + pow(a[1]-b[1], 2) + pow(a[2]-b[2], 2) + pow(a[3]-b[3], 2) )
 
#define V4_MAG(a)   sqrt( pow(a[0], 2) + pow(a[1], 2) + pow(a[2], 2) + pow(a[3], 2) )
 

Typedefs

typedef float StdUtils::StdVector3[3]
 
typedef float StdUtils::StdVector4[4]
 

Enumerations

enum  StdLogLevel {
  StdLogNone = 0, StdLogError = 10, StdLogInfo = 20, StdLogDebug = 30,
  StdLogDetail = 40
}
 

Functions

template<class Type >
const Type & StdUtils::SSMAX (const Type &arg1, const Type &arg2)
 
template<class Type >
const Type & StdUtils::SSMIN (const Type &arg1, const Type &arg2)
 
unsigned char StdUtils::Std_BinaryToGreyCode (unsigned char cVal)
 Converts a binary value to grey code. More...
 
unsigned short StdUtils::Std_BinaryToGreyCode (unsigned short iVal)
 Converts a binary value to grey code. More...
 
unsigned long StdUtils::Std_BinaryToGreyCode (unsigned long lVal)
 Converts a binary value to grey code. More...
 
std::string StdUtils::Std_ByteArrayToHexString (CStdArray< unsigned char > &aryBytes)
 Converts a byte array to hexadecimal string. More...
 
void StdUtils::Std_ByteArrayToHexString (CStdArray< unsigned char > &aryBytes, std::string &strHex)
 Converts a byte array to hexadecimal string. More...
 
std::string StdUtils::Std_CheckString (std::string strVal)
 Converts a string to upper case and trims it. More...
 
std::string StdUtils::Std_Combine (CStdArray< std::string > &aryParts, std::string strDelimiter)
 Combines an array of strings into a single string. More...
 
std::string StdUtils::Std_ConstToVariantType (int iType)
 Standard constant to variant type. More...
 
void StdUtils::Std_CopyBinarySection (CStdArray< unsigned char > &aryInData, long lStartInBit, CStdArray< unsigned char > &aryOutData, long lStartOutBit, long lBitLength)
 Copies a section of a byte array to a new position within the array. More...
 
std::string StdUtils::Std_CreateAppID ()
 Gets the standard create application identifier. More...
 
bool StdUtils::Std_DirectoryExists (std::string strPath)
 Queries if a given directory exists. More...
 
double StdUtils::Std_DRand (double low, double high)
 Generates a random number between two values. More...
 
std::string StdUtils::Std_ExecutablePath ()
 Finds the name and path of the current executable. More...
 
bool StdUtils::Std_FileExists (std::string strFullPath)
 Finds if a given file exists. More...
 
void StdUtils::Std_FlipBitInArray (CStdArray< unsigned char > &aryRawData, long lBit)
 Flips a bit within a byte array. More...
 
void StdUtils::Std_FlipBitRangeInArray (CStdArray< unsigned char > &aryRawData, long lStartBit, long lBitLength)
 Flips all the bits within a section of a byte array. More...
 
float StdUtils::Std_FRand (float low, float high)
 Generates a random number between two values. More...
 
void StdUtils::Std_GetBinarySection (CStdArray< unsigned char > &aryRawData, long lStartBit, long lBitLength, unsigned char &cOut)
 Gets a section of bits from a byte array. More...
 
void StdUtils::Std_GetBinarySection (CStdArray< unsigned char > &aryRawData, long lStartBit, long lBitLength, unsigned short &iOut)
 Gets a section of bits from a byte array. More...
 
void StdUtils::Std_GetBinarySection (CStdArray< unsigned char > &aryRawData, long lStartBit, long lBitLength, unsigned long &lOut)
 Gets a section of bits from a byte array. More...
 
void StdUtils::Std_GetBinarySection (CStdArray< unsigned char > &aryRawData, long lStartBit, long lBitLength, CStdArray< unsigned char > &aryOutData)
 Gets a section of bits from a byte array. More...
 
bool StdUtils::Std_GetBitFromArray (CStdArray< unsigned char > &aryRawData, long lBit)
 Gets a single bit from a byte array. More...
 
long StdUtils::Std_GetBitSize (CStdArray< unsigned char > &aryRawData)
 Gets the number of bits in a byte array. More...
 
unsigned char StdUtils::Std_GetByteFromArray (CStdArray< unsigned char > &aryRawData, long lEndBit, long lBitsNeeded)
 Gets a single byte from a byte array. More...
 
std::string StdUtils::Std_GetLogFilePrefix ()
 Gets the log file prefix. More...
 
unsigned long StdUtils::Std_GetTick ()
 Gets the time tick. More...
 
int StdUtils::Std_GetTraceLevel ()
 Gets the trace level. More...
 
unsigned char StdUtils::Std_GreyCodeToBinary (unsigned char cVal)
 Converts a grey code to a binary value. More...
 
unsigned short StdUtils::Std_GreyCodeToBinary (unsigned short iVal)
 Converts a grey code to a binary value. More...
 
unsigned long StdUtils::Std_GreyCodeToBinary (unsigned long lVal)
 Converts a grey code to a binary value. More...
 
unsigned char StdUtils::Std_HexCharToByte (char cVal)
 Converts a hexidecimal number to a byte. More...
 
void StdUtils::Std_HexStringToByteArray (std::string strHex, CStdArray< unsigned char > &aryBytes)
 Converts a hex string to a byte array. More...
 
unsigned char * StdUtils::Std_HexStringToByteArray (std::string strHex, long &lArraySize)
 Converts a hex string to a byte array. More...
 
unsigned char StdUtils::Std_HexToByte (std::string strVal)
 Converts a hexidecimal number to a byte. More...
 
bool StdUtils::Std_InValidRange (int iMinVal, int iMaxVal, int iVal, bool bThrowError, std::string strParamName)
 Tests whether a number is within a valid range. More...
 
bool StdUtils::Std_InValidRange (long lMinVal, long lMaxVal, long lVal, bool bThrowError, std::string strParamName)
 Standard in valid range. More...
 
bool StdUtils::Std_InValidRange (float fltMinVal, float fltMaxVal, float fltVal, bool bThrowError, std::string strParamName)
 Standard in valid range. More...
 
bool StdUtils::Std_InValidRange (double dblMinVal, double dblMaxVal, double dblVal, bool bThrowError, std::string strParamName)
 Standard in valid range. More...
 
int StdUtils::Std_IRand (int low, int high)
 Generates a random number between two values. More...
 
bool StdUtils::Std_IsAboveMin (int iMinVal, int iVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
 Tests if a number is above a minimum value. More...
 
bool StdUtils::Std_IsAboveMin (long lMinVal, long lVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
 Tests if a number is above a minimum value. More...
 
bool StdUtils::Std_IsAboveMin (float fltMinVal, float fltVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
 Tests if a number is above a minimum value. More...
 
bool StdUtils::Std_IsAboveMin (double dblMinVal, double dblVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
 Tests if a number is above a minimum value. More...
 
bool StdUtils::Std_IsBelowMax (int iMaxVal, int iVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
 Tests if a number is below a maximum value. More...
 
bool StdUtils::Std_IsBelowMax (long lMaxVal, long lVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
 Tests if a number is below a maximum value. More...
 
bool StdUtils::Std_IsBelowMax (float fltMaxVal, float fltVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
 Tests if a number is below a maximum value. More...
 
bool StdUtils::Std_IsBelowMax (double dblMaxVal, double dblVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
 Tests if a number is below a maximum value. More...
 
bool StdUtils::Std_IsBlank (std::string strVal)
 Trims a string and tests if a string is blank. More...
 
bool StdUtils::Std_IsFullPath (std::string strPath)
 determines if this is a full path name. More...
 
bool StdUtils::Std_IsIntegerType (std::string strVal)
 Tests if this string is an integer. More...
 
bool StdUtils::Std_IsNumeric (std::string strVal)
 Tests if this string is a number. More...
 
std::string StdUtils::Std_Left (std::string strVal, int iCount)
 Gets the left portion of a substring. More...
 
void StdUtils::Std_Log (const int nLevel, bool bPrintHeader, LPCTSTR strFormat,...)
 
void StdUtils::Std_LogMsg (const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bPrintHeader)
 Logs a message,. More...
 
long StdUtils::Std_LRand (long low, long high)
 Generates a random number between two values. More...
 
std::string StdUtils::Std_NullStr (std::string strFormat)
 If string is blank it uses NULL instead. More...
 
bool StdUtils::Std_ReadBinaryData (CStdArray< unsigned char > &aryBinaryData, long lLastBit, long &lStartBit, long lBitLength, unsigned char &cOut)
 Reads binary data from a byte array. More...
 
bool StdUtils::Std_ReadBinaryData (CStdArray< unsigned char > &aryBinaryData, long lLastBit, long &lStartBit, long lBitLength, unsigned short &iOut)
 Reads binary data from a byte array. More...
 
bool StdUtils::Std_ReadBinaryData (CStdArray< unsigned char > &aryBinaryData, long lLastBit, long &lStartBit, long lBitLength, unsigned long &lOut)
 Reads binary data from a byte array. More...
 
void StdUtils::Std_RelayError (CStdErrorInfo oInfo, std::string strSourceFile, long lSourceLine)
 Standard relay error. More...
 
std::string StdUtils::Std_Replace (std::string strVal, std::string strFind, std::string strReplace)
 Replaces a substring with another string. More...
 
void StdUtils::Std_ResetLog ()
 
std::string StdUtils::Std_RetrieveParam (int argc, const char **argv, std::string strParamName, bool bThrowError)
 
long StdUtils::Std_RGB (unsigned char iRed, unsigned char iGreen, unsigned char iBlue)
 Generates a long representation of a color. More...
 
std::string StdUtils::Std_Right (std::string strVal, int iCount)
 Gets the right portion of a substring. More...
 
void StdUtils::Std_SetBinarySection (CStdArray< unsigned char > &aryRawData, long lStartBit, long lBitLength, unsigned char cIn)
 Replaces a section of a byte array with a new byte array. More...
 
void StdUtils::Std_SetBinarySection (CStdArray< unsigned char > &aryRawData, long lStartBit, long lBitLength, unsigned short iIn)
 Replaces a section of a byte array with a new byte array. More...
 
void StdUtils::Std_SetBinarySection (CStdArray< unsigned char > &aryRawData, long lStartBit, long lBitLength, unsigned long lIn)
 Replaces a section of a byte array with a new byte array. More...
 
void StdUtils::Std_SetBinarySection (CStdArray< unsigned char > &aryRawData, long lStartBit, long lBitLength, CStdArray< unsigned char > &aryInData)
 Replaces a section of a byte array with a new byte array. More...
 
void StdUtils::Std_SetBitInArray (CStdArray< unsigned char > &aryRawData, long lBit, bool bVal)
 Sets a bit within an array. More...
 
void StdUtils::Std_SetBitRangeInArray (CStdArray< unsigned char > &aryRawData, long lStartBit, long lBitLength, bool bVal)
 Sets an entire section within a byte array with a bit value. More...
 
void StdUtils::Std_SetByteInArray (CStdArray< unsigned char > &aryRawData, unsigned char cIn, long lEndBit, long lBitsNeeded)
 Sets a byte within an array. More...
 
void StdUtils::Std_SetFileTime (std::string strFilename)
 
void StdUtils::Std_SetLogFilePrefix (std::string strFilePrefix)
 Sets the log file prefix. More...
 
void StdUtils::Std_SetLogLevel (const int iLevel)
 Sets the log level. More...
 
void StdUtils::Std_SetTraceLevel (const int iVal)
 Sets teh trace level. More...
 
int StdUtils::Std_Sign (float fltVal)
 Determines the sign of a number. More...
 
int StdUtils::Std_Sign (float fltVal, float fltDefault)
 Determines the sign of a number. If the number is 0 then it uses the default value supplied. More...
 
void StdUtils::Std_Sleep (unsigned long lMilliseconds)
 
int StdUtils::Std_Split (const std::string &input, const std::string &delimiter, CStdArray< std::string > &results)
 Splits a string into an array of subparts based on a delimiter. More...
 
void StdUtils::Std_SplitPathAndFile (std::string &strFullPath, std::string &strPath, std::string &strFile)
 Splits the path from the actual filename. More...
 
void StdUtils::Std_SRand (unsigned long lSeed)
 Sets the seed for generating a random number. More...
 
void StdUtils::Std_ThrowError (long lError, std::string strError, std::string strSourceFile, long lSourceLine, std::string strValueName, unsigned char iVal)
 Standard throw error. More...
 
void StdUtils::Std_ThrowError (long lError, std::string strError, std::string strSourceFile, long lSourceLine, std::string strValueName, unsigned short iVal)
 Standard throw error. More...
 
void StdUtils::Std_ThrowError (long lError, std::string strError, std::string strSourceFile, long lSourceLine, std::string strValueName, int iVal)
 Standard throw error. More...
 
void StdUtils::Std_ThrowError (long lError, std::string strError, std::string strSourceFile, long lSourceLine, std::string strValueName, long lVal)
 Standard throw error. More...
 
void StdUtils::Std_ThrowError (long lError, std::string strError, std::string strSourceFile, long lSourceLine, std::string strValueName, float fltVal)
 Standard throw error. More...
 
void StdUtils::Std_ThrowError (long lError, std::string strError, std::string strSourceFile, long lSourceLine, std::string strValueName, double dblVal)
 Standard throw error. More...
 
void StdUtils::Std_ThrowError (long lError, std::string strError, std::string strSourceFile, long lSourceLine, std::string strValueName, std::string strVal)
 Standard throw error. More...
 
void StdUtils::Std_ThrowError (long lError, std::string strError, std::string strSourceFile, long lSourceLine, std::string strText)
 Standard throw error. More...
 
bool StdUtils::Std_ToBool (int iVal)
 Converts a value toa bool. More...
 
bool StdUtils::Std_ToBool (std::string strVal)
 Converts a value toa bool. More...
 
std::string StdUtils::Std_ToLower (std::string strVal)
 Converts a string to lower case. More...
 
std::string StdUtils::Std_ToStr (std::string strVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToStr (const char *strVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToStr (unsigned char iVal)
 Converts a value to a std::string. More...
 
std::string StdUtils::Std_ToStr (unsigned short iVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToStr (int iVal)
 Converts a value to a std::string. More...
 
std::string StdUtils::Std_ToStr (unsigned int iVal)
 Converts a value to a std::string. More...
 
std::string StdUtils::Std_ToStr (long lVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToStr (unsigned long lVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToStr (float fltVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToStr (double dblVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToStr (bool bVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToStr (std::string strFormat, unsigned char iVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToStr (std::string strFormat, unsigned short iVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToStr (std::string strFormat, int iVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToStr (std::string strFormat, long lVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToStr (std::string strFormat, float fltVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToStr (std::string strFormat, double dblVal)
 Converts a value to a string. More...
 
std::string StdUtils::Std_ToUpper (std::string strVal)
 Converts a string to upper case. More...
 
void StdUtils::Std_TraceMsg (const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bLogToFile, bool bPrintHeader)
 Traces a message to the debugger window. More...
 
std::string StdUtils::Std_Trim (std::string strVal)
 Trims a string. More...
 
std::string StdUtils::Std_TrimLeft (std::string strVal)
 Standard trim left. More...
 
std::string StdUtils::Std_TrimRight (std::string strVal)
 Standard trim right. More...
 
int StdUtils::Std_VariantTypeToConst (std::string strType)
 Standard variant type to constant. More...
 
void StdUtils::Std_WriteBinaryData (CStdArray< unsigned char > &aryBinaryData, long &lStartBit, long lBitLength, unsigned char cIn)
 Writes data to a byte array. More...
 
void StdUtils::Std_WriteBinaryData (CStdArray< unsigned char > &aryBinaryData, long &lStartBit, long lBitLength, unsigned short iIn)
 Writes data to a byte array. More...
 
void StdUtils::Std_WriteBinaryData (CStdArray< unsigned char > &aryBinaryData, long &lStartBit, long lBitLength, unsigned long lIn)
 Writes data to a byte array. More...
 

Detailed Description

Declares the standard utility functions class.

Definition in file StdUtilFunctions.h.