![]() |
Developer Application Interface (ARC API) v4.5.9
ARC, Inc. GenIV Application Interface
|
#include <CArcBase.h>
Public Member Functions | |
virtual | ~CArcBase (void) |
Static Public Member Functions | |
static const std::string | version (void) |
static void | zeroMemory (void *pDest, std::size_t uiSize) |
static void | copyMemory (void *pDest, void *pSrc, std::size_t uiSize) |
template<typename T > | |
static std::tuple< T *, T * > | copyAndIncrement (void *pDest, void *pSrc, const std::size_t uiSize) |
template<typename ErrCode > requires std::is_integral_v<ErrCode> | |
static const std::string | getSystemErrorMessage (ErrCode iErrCode) |
static const std::string | getSystemErrorMessage (void) |
static std::uint32_t | getSystemError (void) noexcept |
static pStringList_t | splitString (const std::string &sString, const char &zDelim=' ') |
static std::string | formatString (const char *pszFmt,...) |
static const std::filesystem::path | incrementFileName (const std::filesystem::path &tFilePath="", const std::int32_t iStartValue=-1) |
static std::filesystem::path | getFileName (const std::string &sFilter="Gen IV Microcontroller binary file\0*.bin\0All\0*.*\0"s) noexcept |
static std::string | convertWideToAnsi (const wchar_t wzString[]) noexcept |
static std::string | convertWideToAnsi (const std::wstring &wsString) |
static std::wstring | convertAnsiToWide (const char *pszString) |
static std::string | cmdToString (const std::uint32_t uiCmd) |
static std::string | uintToString (const std::uint32_t uiValue) noexcept |
template<typename T > | |
static std::string | iterToString (T *begin, T *end, const char zSeperator=' ') |
static std::unique_ptr< std::uint8_t[]> | readFileBytes (const std::filesystem::path &tFilePath, std::uint32_t &uiFileLength) |
static std::string | setDots (std::string_view svText, const std::size_t uiMaxLength, const char szDot='.') |
static std::string | trim (const std::string &sText) noexcept |
static std::size_t | replaceAll (std::string &sText, std::string_view svWhat, std::string_view svWith) |
static float | uintToFloat (const std::uint32_t uiValue) |
static const std::chrono::time_point< std::chrono::high_resolution_clock > | startCodeTime (void) noexcept |
template<typename T > | |
static constexpr auto | endCodeTime (const std::chrono::time_point< std::chrono::high_resolution_clock > tStartTimePoint) noexcept |
Protected Member Functions | |
CArcBase (void)=default | |
CArcBase (const CArcBase &)=delete | |
CArcBase (CArcBase &&)=delete | |
CArcBase & | operator= (const CArcBase &)=delete |
CArcBase & | operator= (CArcBase &&)=delete |
Static Protected Attributes | |
static const std::string | m_sVersion |
Standard ARC device base class that makes a set of useful methods available to all subclasses. Class methods include throwing formatted exceptions, ascii to string command conversion, error uiCode formatting and character conversion ( unicode to ascii and vice versa ).
Definition at line 233 of file CArcBase.h.
|
virtual |
Destructor
|
protecteddefault |
Default constructor
|
protecteddelete |
Delete copy constructor
|
protecteddelete |
Delete move constructor
|
static |
Returns a textual representation of the library version and compile date and time.
|
static |
Zero out the specified buffer.
pDest | - Pointer to the buffer to zero. |
uiSize | - The size of the buffer ( in bytes ). |
std::invalid_argument | if arguments are invalid. |
|
static |
Copies the source buffer into the destination buffer.
pDest | - Pointer to the destination buffer to copy into. |
pSrc | - Pointer to the source buffer to copy out of. |
uiSize | - The size of the buffers ( in bytes ). |
std::invalid_argument | if arguments are invalid. |
|
inlinestatic |
Copies the source buffer into the destination buffer. The pointers are incremented.
pDest | - Pointer to the destination buffer to copy into. |
pSrc | - Pointer to the source buffer to copy out of. |
uiSize | - The size of the buffers ( in bytes ). |
std::invalid_argument | if arguments are invalid. |
Definition at line 266 of file CArcBase.h.
|
inlinestatic |
Returns a string that represents the specified system error uiCode.
uiCode/iCode | - The system specific error uiCode ( GetLastError() on Windows, errno on Linux ). |
std::ios_base::failure |
Definition at line 302 of file CArcBase.h.
|
static |
Returns a string that describes the last system error as returned from GetLastError() on Windows and errno on Linux.
std::ios_base::failure |
|
inlinestaticnoexcept |
Returns the current system error code.
Definition at line 377 of file CArcBase.h.
|
static |
Splits a string based on the specified deliminator.
sString | - The string to split. |
zDelim | - The character used to split the string ( default = ' ' ). |
std::regex_error |
|
static |
Formats a std::string using printf-style formatting. Acceptable format string specifiers:
Acceptable format string specifiers: %u -> unsigned integer %d -> integer %f -> double %l -> long %j -> unsigned long %J -> unsigned long long %s -> char * string %e -> system message (as returned by errno or GetLastError) %b -> bool %x/X -> 32-bit lower/upper case hexadecimal integer. %p -> 64-bit upper case hexadecimal integer ( pointer )
pszFmt | - A printf-style format string. See above for specifiers. |
... | - Arguments to fill in format string specifiers. |
std::ios_base::failure |
|
static |
Modifies the specified filename to contain an increment value string ("_#). The increment value starts at zero by default. To reset the increment value back to zero, pass in the default values. @param tFilePath - The un-modified filename to modify with an increment value (default: "" ).
iStartValue | - The increment start value or -1 to reset back to zero (default: -1). |
std::runtime_error | and any error thrown by the std::filesystem methods ( parent_path, stem, extension, /=, += ). |
|
staticnoexcept |
Windows only - Opens a file selection dialog window sFilter - The dialog file filter string. Default filters for a micro-controller binary file or all files. Format is as follows: "text description 1\0file extension 1\0text description 2\0file extension 2\0" NOTE: Each part, including the end, must end with a \0 character
|
staticnoexcept |
Converts a unicode character array to an ansi string.
wzString | - The unicode character array to convert. |
|
static |
Converts a unicode string to an ansi string.
wsString | - The unicode string to convert. |
std::ios_base::failure |
|
static |
Converts an ansi string to a unicode string.
pszString | - The ansi string to convert. |
std::ios_base::failure |
|
static |
Converts a device or controller ascii command to a string represented by changing each each byte to its ascii letter equivalent. This is useful for logging human readable versions of a command. For example, 0x54444C would be converted to "TDL". If the command fails to be converted, then the hexadecimal value is returned as a string. For example, 0x212223 would be returned as "0x212223" and not "!*#".
uiCmd | - A device or controller ascii command. |
std::ios_base::failure |
|
staticnoexcept |
Converts the specified value to a string where each byte in the integer parameter is converted to its equivalent ascii text character. Only printable characters are converted. All others are ignored and left out of the returned string.
uiValue | - The value to byte convert to ascii text characters |
|
inlinestatic |
Moves through the specified iterator positions and places each value into a return string that is seperated by the specified zSeperator.
Example: std::initializer_list<std::uint32_t> list = { 1, 2, 3, 4 }; produces the following output: "1 2 3 4 "
begin | - Pointer to iterator to the first element. |
end | - Pointer to iterator to the last element. |
zSeperator | - Seperator character ( default = ' ' ). |
std::invalid_argument | |
std::ios_base::failure |
Definition at line 499 of file CArcBase.h.
|
static |
Reads and returns all the bytes from a binary file.
tFilePath | - The binary file eto read. |
uiFileLength | - On return contains the byte length of the file. |
std::runtime_error | |
std::invalid_argument | |
std::length_error |
|
static |
Appends dots to the end of the specified string to show a connection to a component.
svText | - The text to append the dots too. |
uiMaxLength | - The maximum length of the returned string. |
szDot | - The dot character (default = '.'). |
std::ios_base::failure | |
std::length_error |
|
staticnoexcept |
Trims the leading and trailing whitespace from the text.
sText | - The text to trim leading and trailing whitespace from. |
|
static |
Replaces the specified string with a new value
sText | - The text to modify |
svWhat | - The text to search for |
svWith | - The new text used to replace any found search text values |
std::out_of_range | |
std::length_error |
|
static |
Convert an unsigned integer value to a floating point. This is used to convert a float value sent by the controller as an unsigned integer back to a float value.
uiValue | - The unsigned integer version of a float value to convert back to a float |
std::runtime_error |
|
staticnoexcept |
Reads the current time point using the std::high_resolution_clock for timing a piece of code. This is the start time to be called first.
|
inlinestaticconstexprnoexcept |
Reads the current time point using the std::high_resolution_clock and subtracts the specified start time point for timing a piece of code. This is the end time to be called second.
tStartTimePoint | - The start time point returned by startCodeTime() method. |
Definition at line 584 of file CArcBase.h.
Delete copy assignment constructor
Delete move assignment constructor
|
staticprotected |
version() text holder
Definition at line 611 of file CArcBase.h.