4901 lines
169 KiB
C++
4901 lines
169 KiB
C++
/**
|
|
* @file include/ActivMiddleware/ActivBase/MessageValidator.h
|
|
*
|
|
* @brief Header file for the message validator class.
|
|
*/
|
|
|
|
#if (!defined ACTIV_BASE_MESSAGE_VALIDATOR_H)
|
|
#define ACTIV_BASE_MESSAGE_VALIDATOR_H
|
|
|
|
#include "ActivMiddleware/ActivBase/External.h"
|
|
#include "ActivMiddleware/ActivBase/MessageHandler.h"
|
|
#include "ActivMiddleware/CxxYZ/string_view.h"
|
|
#include "ActivMiddleware/Misc/MemoryHelper.h"
|
|
|
|
#include <float.h>
|
|
#include <vector>
|
|
#include <limits>
|
|
#include <cassert>
|
|
|
|
//! Activ namespace.
|
|
namespace Activ
|
|
{
|
|
|
|
/**
|
|
* @brief Message validator class.
|
|
*/
|
|
class MessageValidator : public MessageHandler
|
|
{
|
|
public:
|
|
/**
|
|
* @brief Default constructor.
|
|
*
|
|
* @param pMessage the address of the message.
|
|
* @param length the length of the message.
|
|
* @param messageVersion optional version.
|
|
*/
|
|
MessageValidator(const void *pMessage = 0, const size_t length = 0,
|
|
const MessageVersion messageVersion = MESSAGE_VERSION_UNDEFINED);
|
|
|
|
/**
|
|
* @brief Initialize with a new contiguous message.
|
|
*
|
|
* @param pMessage the address of the message.
|
|
* @param length the length of the message.
|
|
* @param messageVersion optional version.
|
|
*/
|
|
void Initialize(const void *pMessage, const size_t length, const MessageVersion messageVersion = MESSAGE_VERSION_UNDEFINED);
|
|
|
|
/**
|
|
* @brief Reset.
|
|
*
|
|
* @param messageVersion optional version.
|
|
*/
|
|
void Reset(const MessageVersion messageVersion = MESSAGE_VERSION_UNDEFINED);
|
|
|
|
/**
|
|
* @brief Get the address of the message.
|
|
*
|
|
* @return The address of the message.
|
|
*/
|
|
const void *GetMessage() const;
|
|
|
|
/**
|
|
* @brief Get the length of the message.
|
|
*
|
|
* @return the length of the message.
|
|
*/
|
|
size_t GetLength() const;
|
|
|
|
/**
|
|
* @brief Get the current offset within the message.
|
|
*
|
|
* @return The offset within the message.
|
|
*/
|
|
size_t GetOffset() const;
|
|
|
|
/**
|
|
* @brief Set the current offset within the message.
|
|
*
|
|
* @param offset the offset within the message.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
StatusCode SetOffset(const size_t offset);
|
|
|
|
/**
|
|
* @brief Is the end of message.
|
|
*
|
|
* @return whether the end of message has been reached.
|
|
*/
|
|
bool IsEndOfMessage() const;
|
|
|
|
/**
|
|
* @brief Validate bytes.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
StatusCode ValidateBytesRef(const size_t length, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate bytes.
|
|
*
|
|
* @param length the length of the buffer.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
StatusCode ValidateBytes(const size_t length);
|
|
|
|
/**
|
|
* @brief Validate bytes.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param pComperand data (of length @a length) to compare to.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateBytesCompare(const size_t length, const void * const pComperand, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate bytes.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param pComperand data (of length @a length) to compare to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateBytesCompare(const size_t length, const void * const pComperand);
|
|
|
|
/**
|
|
* @brief Validate bytes.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param value the value to compare all bytes in the buffer to.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateBytes(const size_t length, const byte_t value, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate bytes.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param value the value to compare all bytes in the buffer to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateBytes(const size_t length, const byte_t value);
|
|
|
|
/**
|
|
* @brief Validate bytes.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateBytesRange(const size_t length, const byte_t lower, const byte_t upper, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate bytes.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateBytesRange(const size_t length, const byte_t lower, const byte_t upper);
|
|
|
|
/**
|
|
* @brief Validate bytes.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param set the set of allowed values.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateBytesSet(const size_t length, const std::vector<byte_t> &set, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate bytes.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param set the set of allowed values.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateBytesSet(const size_t length, const std::vector<byte_t> &set);
|
|
|
|
/**
|
|
* @brief Validate bytes.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param set the set of allowed values.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateBytesSet(const size_t length, const std::vector<String> &set, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate bytes.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param set the set of allowed values.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateBytesSet(const size_t length, const std::vector<String> &set);
|
|
|
|
/**
|
|
* @brief Validate bytes and copy.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateBytesCopy(const size_t length, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate bytes and copy.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateBytesRangeCopy(const size_t length, const byte_t lower, const byte_t upper, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate bytes and copy.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param set the set of allowed values.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateBytesSetCopy(const size_t length, const std::vector<byte_t> &set, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate bytes and copy.
|
|
*
|
|
* @param length the length of the buffer.
|
|
* @param set the set of allowed values.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateBytesSetCopy(const size_t length, const std::vector<String> &set, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed or unsigned binary integral value.
|
|
*
|
|
* SIZE the number of bytes to validate.
|
|
* ENDIAN the endian of the source.
|
|
* T the type of the variable to receive the value.
|
|
*
|
|
* @param value reference to a variable to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
template<size_t SIZE, Endian ENDIAN, typename T>
|
|
StatusCode ValidateBinaryIntegral(T &value);
|
|
|
|
/**
|
|
* @brief Validate a signed or unsigned ACTIV binary integral value.
|
|
*
|
|
* This is a convenience method for ValidateBinaryIntegral assuming little endian and sizeof(T) size.
|
|
*
|
|
* T the type of the variable to receive the value.
|
|
*
|
|
* @param value reference to a variable to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
template<typename T>
|
|
StatusCode ValidateActivIntegral(T &value);
|
|
|
|
/**
|
|
* @brief Validate a signed or unsigned binary integral value.
|
|
*
|
|
* SIZE the number of bytes to validate.
|
|
* ENDIAN the endian of the source.
|
|
* T the type of the variable to receive the value.
|
|
* LOWER the lower bound value.
|
|
* UPPER the upper bound value.
|
|
*
|
|
* @param value reference to a variable to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template<size_t SIZE, Endian ENDIAN, typename T, T LOWER, T UPPER>
|
|
StatusCode ValidateBinaryIntegralRange(T &value);
|
|
|
|
/**
|
|
* @brief Validate a signed or unsigned binary integral value.
|
|
*
|
|
* SIZE the number of bytes to validate.
|
|
* ENDIAN the endian of the source.
|
|
* T the type of the variable to receive the value.
|
|
*
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value reference to a variable to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template<size_t SIZE, Endian ENDIAN, typename T>
|
|
StatusCode ValidateBinaryIntegralRange(const T lower, const T upper, T &value);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateAsciiHexadecimalIntegral(const size_t size, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateAsciiHexadecimalIntegral(const size_t size);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateAsciiHexadecimalIntegral(const size_t size, T &value, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateAsciiHexadecimalIntegral(const size_t size, T &value);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateAsciiHexadecimalIntegralRange(const size_t size, const uint64_t lower, const uint64_t upper,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateAsciiHexadecimalIntegralRange(const size_t size, const uint64_t lower, const uint64_t upper);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateAsciiHexadecimalIntegralRange(const size_t size, const uint64_t lower, const uint64_t upper, T &value,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateAsciiHexadecimalIntegralRange(const size_t size, const uint64_t lower, const uint64_t upper, T &value);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateAsciiHexadecimalIntegralSet(const size_t size, const std::vector<uint64_t> &set, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateAsciiHexadecimalIntegralSet(const size_t size, const std::vector<uint64_t> &set);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateAsciiHexadecimalIntegralSet(const size_t size, const std::vector<uint64_t> &set, T &value,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateAsciiHexadecimalIntegralSet(const size_t size, const std::vector<uint64_t> &set, T &value);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateAsciiHexadecimalIntegralCopy(const size_t size, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateAsciiHexadecimalIntegralCopy(const size_t size, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateAsciiHexadecimalIntegralRangeCopy(const size_t size, const uint64_t lower, const uint64_t upper,
|
|
void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateAsciiHexadecimalIntegralRangeCopy(const size_t size, const uint64_t lower, const uint64_t upper, T &value,
|
|
void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateAsciiHexadecimalIntegralSetCopy(const size_t size, const std::vector<uint64_t> &set, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an ASCII hexadecimal integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateAsciiHexadecimalIntegralSetCopy(const size_t size, const std::vector<uint64_t> &set, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiIntegral(const size_t length, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiIntegral(const size_t length);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiIntegral(const size_t length, T &value, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiIntegral(const size_t length, T &value);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiIntegralRange(const size_t length, const int64_t lower, const int64_t upper,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiIntegralRange(const size_t length, const int64_t lower, const int64_t upper);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiIntegralRange(const size_t length, const int64_t lower, const int64_t upper, T &value,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiIntegralRange(const size_t length, const int64_t lower, const int64_t upper, T &value);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateSignedAsciiIntegralSet(const size_t length, const std::vector<int64_t> &set, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateSignedAsciiIntegralSet(const size_t length, const std::vector<int64_t> &set);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiIntegralSet(const size_t length, const std::vector<int64_t> &set, T &value, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiIntegralSet(const size_t length, const std::vector<int64_t> &set, T &value);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param pCopy the address to copy the data to.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiIntegralCopy(const size_t length, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiIntegralCopy(const size_t length, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiIntegralRangeCopy(const size_t length, const int64_t lower, const int64_t upper,
|
|
void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiIntegralRangeCopy(const size_t length, const int64_t lower, const int64_t upper, T &value,
|
|
void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiIntegralSetCopy(const size_t length, const std::vector<int64_t> &set, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII integral value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiIntegralSetCopy(const size_t length, const std::vector<int64_t> &set, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiReal(const size_t length, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiReal(const size_t length);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiReal(const size_t length, T &value, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiReal(const size_t length, T &value);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiReal(const size_t length, int64_t &numerator, uint64_t &divisor,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiReal(const size_t length, int64_t &numerator, uint64_t &divisor);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateSignedAsciiRealRange(const size_t length, const long double lower, const long double upper,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateSignedAsciiRealRange(const size_t length, const long double lower, const long double upper);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiRealRange(const size_t length, const long double lower, const long double upper, T &value,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiRealRange(const size_t length, const long double lower, const long double upper, T &value);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiRealRange(const size_t length, const long double lower, const long double upper,
|
|
int64_t &numerator, uint64_t &divisor, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiRealRange(const size_t length, const long double lower, const long double upper,
|
|
int64_t &numerator, uint64_t &divisor);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateSignedAsciiRealSet(const size_t length, const std::vector<long double> &set, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateSignedAsciiRealSet(const size_t length, const std::vector<long double> &set);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiRealSet(const size_t length, const std::vector<long double> &set, T &value,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiRealSet(const size_t length, const std::vector<long double> &set, T &value);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiRealSet(const size_t length, const std::vector<long double> &set,
|
|
int64_t &numerator, uint64_t &divisor, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiRealSet(const size_t length, const std::vector<long double> &set,
|
|
int64_t &numerator, uint64_t &divisor);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiRealCopy(const size_t length, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiRealCopy(const size_t length, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiRealCopy(const size_t length, int64_t &numerator, uint64_t &divisor, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateSignedAsciiRealRangeCopy(const size_t length, const long double lower, const long double upper, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiRealRangeCopy(const size_t length, const long double lower, const long double upper, T &value,
|
|
void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiRealRangeCopy(const size_t length, const long double lower,
|
|
const long double upper, int64_t &numerator, uint64_t &divisor, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateSignedAsciiRealSetCopy(const size_t length, const std::vector<long double> &set, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateSignedAsciiRealSetCopy(const size_t length, const std::vector<long double> &set, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedAsciiRealSetCopy(const size_t length, const std::vector<long double> &set,
|
|
int64_t &numerator, uint64_t &divisor, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedBinaryIntegral(const size_t size, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedBinaryIntegral(const size_t size);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateSignedBinaryIntegral(const size_t size, T &value, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateSignedBinaryIntegral(const size_t size, T &value);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateSignedBinaryIntegralRange(const size_t size, const int64_t lower, const int64_t upper, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateSignedBinaryIntegralRange(const size_t size, const int64_t lower, const int64_t upper);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateSignedBinaryIntegralRange(const size_t size, const int64_t lower, const int64_t upper, T &value,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateSignedBinaryIntegralRange(const size_t size, const int64_t lower, const int64_t upper, T &value);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateSignedBinaryIntegralSet(const size_t size, const std::vector<int64_t> &set, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template<Endian ENDIAN>
|
|
StatusCode ValidateSignedBinaryIntegralSet(const size_t size, const std::vector<int64_t> &set);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateSignedBinaryIntegralSet(const size_t size, const std::vector<int64_t> &set, T &value, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateSignedBinaryIntegralSet(const size_t size, const std::vector<int64_t> &set, T &value);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateSignedBinaryIntegralCopy(const size_t size, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateSignedBinaryIntegralCopy(const size_t size, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateSignedBinaryIntegralRangeCopy(const size_t size, const int64_t lower, const int64_t upper, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateSignedBinaryIntegralRangeCopy(const size_t size, const int64_t lower, const int64_t upper, T &value,
|
|
void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateSignedBinaryIntegralSetCopy(const size_t size, const std::vector<int64_t> &set, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a signed binary integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateSignedBinaryIntegralSetCopy(const size_t size, const std::vector<int64_t> &set, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate string.
|
|
*
|
|
* T is the type of the length field and can be either uint8_t or uint16_t.
|
|
*
|
|
* @param string to assign the string to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
#if (ACTIV_CPLUSPLUS >= ACTIV_CPLUSPLUS_11)
|
|
template<typename T = DefaultStringLength>
|
|
#endif
|
|
ACTIV_BASE_API StatusCode ValidateString(String &string);
|
|
|
|
/**
|
|
* @brief Validate a string_view.
|
|
*
|
|
* T is the type of the length field and can be either uint8_t or uint16_t.
|
|
*
|
|
* @param stringView to assign the string view to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
#if (ACTIV_CPLUSPLUS >= ACTIV_CPLUSPLUS_11)
|
|
template<typename T = DefaultStringLength>
|
|
#endif
|
|
StatusCode ValidateString(CxxYZ::string_view &stringView);
|
|
|
|
/**
|
|
* @brief Validate string.
|
|
*
|
|
* T is the type of the length field and can be either uint8_t or uint16_t.
|
|
*
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param string the location to copy the string to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
#if (ACTIV_CPLUSPLUS >= ACTIV_CPLUSPLUS_11)
|
|
template<typename T = DefaultStringLength>
|
|
#endif
|
|
ACTIV_BASE_API StatusCode ValidateStringRange(const byte_t lower, const byte_t upper, String &string);
|
|
|
|
/**
|
|
* @brief Validate string.
|
|
*
|
|
* T is the type of the length field and can be either uint8_t or uint16_t.
|
|
*
|
|
* @param set the set of allowed values.
|
|
* @param string the location to copy the string to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
#if (ACTIV_CPLUSPLUS >= ACTIV_CPLUSPLUS_11)
|
|
template<typename T = DefaultStringLength>
|
|
#endif
|
|
ACTIV_BASE_API StatusCode ValidateStringSet(const std::vector<byte_t> &set, String &string);
|
|
|
|
/**
|
|
* @brief Validate string.
|
|
*
|
|
* T is the type of the length field and can be either uint8_t or uint16_t.
|
|
*
|
|
* @param set the set of allowed values.
|
|
* @param string to assign the string to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
#if (ACTIV_CPLUSPLUS >= ACTIV_CPLUSPLUS_11)
|
|
template<typename T = DefaultStringLength>
|
|
#endif
|
|
ACTIV_BASE_API StatusCode ValidateStringSet(const std::vector<String> &set, String &string);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiIntegral(const size_t length, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiIntegral(const size_t length);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiIntegral(const size_t length, T &value, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiIntegral(const size_t length, T &value);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateUnsignedAsciiIntegralRange(const size_t length, const uint64_t lower, const uint64_t upper,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateUnsignedAsciiIntegralRange(const size_t length, const uint64_t lower, const uint64_t upper);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiIntegralRange(const size_t length, const uint64_t lower, const uint64_t upper, T &value,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiIntegralRange(const size_t length, const uint64_t lower, const uint64_t upper, T &value);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateUnsignedAsciiIntegralSet(const size_t length, const std::vector<uint64_t> &set, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateUnsignedAsciiIntegralSet(const size_t length, const std::vector<uint64_t> &set);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiIntegralSet(const size_t length, const std::vector<uint64_t> &set, T &value,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiIntegralSet(const size_t length, const std::vector<uint64_t> &set, T &value);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param pCopy the address to copy the data to.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiIntegralCopy(const size_t length, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiIntegralCopy(const size_t length, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiIntegralRangeCopy(const size_t length, const uint64_t lower,
|
|
const uint64_t upper, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiIntegralRangeCopy(const size_t length, const uint64_t lower, const uint64_t upper, T &value,
|
|
void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiIntegralSetCopy(const size_t length, const std::vector<uint64_t> &set,
|
|
void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII integral value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiIntegralSetCopy(const size_t length, const std::vector<uint64_t> &set, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiReal(const size_t length, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiReal(const size_t length);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiReal(const size_t length, T &value, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiReal(const size_t length, T &value);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiReal(const size_t length, uint64_t &numerator, uint64_t &divisor,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiReal(const size_t length, uint64_t &numerator, uint64_t &divisor);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateUnsignedAsciiRealRange(const size_t length, const long double lower, const long double upper,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateUnsignedAsciiRealRange(const size_t length, const long double lower, const long double upper);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiRealRange(const size_t length, const long double lower, const long double upper, T &value,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiRealRange(const size_t length, const long double lower, const long double upper, T &value);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiRealRange(const size_t length, const long double lower, const long double upper,
|
|
uint64_t &numerator, uint64_t &divisor, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiRealRange(const size_t length, const long double lower, const long double upper,
|
|
uint64_t &numerator, uint64_t &divisor);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateUnsignedAsciiRealSet(const size_t length, const std::vector<long double> &set, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateUnsignedAsciiRealSet(const size_t length, const std::vector<long double> &set);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiRealSet(const size_t length, const std::vector<long double> &set, T &value,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiRealSet(const size_t length, const std::vector<long double> &set, T &value);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiRealSet(const size_t length, const std::vector<long double> &set,
|
|
uint64_t &numerator, uint64_t &divisor, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiRealSet(const size_t length, const std::vector<long double> &set,
|
|
uint64_t &numerator, uint64_t &divisor);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiRealCopy(const size_t length, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiRealCopy(const size_t length, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiRealCopy(const size_t length, uint64_t &numerator, uint64_t &divisor,
|
|
void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateUnsignedAsciiRealRangeCopy(const size_t length, const long double lower, const long double upper,
|
|
void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiRealRangeCopy(const size_t length, const long double lower, const long double upper, T &value,
|
|
void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiRealRangeCopy(const size_t length, const long double lower,
|
|
const long double upper, uint64_t &numerator, uint64_t &divisor, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateUnsignedAsciiRealSetCopy(const size_t length, const std::vector<long double> &set, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
StatusCode ValidateUnsignedAsciiRealSetCopy(const size_t length, const std::vector<long double> &set, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned ASCII real value and copy.
|
|
*
|
|
* @param length the length of the value.
|
|
* @param set the set of allowed values.
|
|
* @param numerator to receive the numerator.
|
|
* @param divisor to receive the divisor.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedAsciiRealSetCopy(const size_t length, const std::vector<long double> &set,
|
|
uint64_t &numerator, uint64_t &divisor, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedBinaryIntegral(const size_t size, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedBinaryIntegral(const size_t size);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateUnsignedBinaryIntegral(const size_t size, T &value, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateUnsignedBinaryIntegral(const size_t size, T &value);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateUnsignedBinaryIntegralRange(const size_t size, const uint64_t lower, const uint64_t upper,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateUnsignedBinaryIntegralRange(const size_t size, const uint64_t lower, const uint64_t upper);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateUnsignedBinaryIntegralRange(const size_t size, const uint64_t lower, const uint64_t upper, T &value,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateUnsignedBinaryIntegralRange(const size_t size, const uint64_t lower, const uint64_t upper, T &value);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateUnsignedBinaryIntegralSet(const size_t size, const std::vector<uint64_t> &set, const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateUnsignedBinaryIntegralSet(const size_t size, const std::vector<uint64_t> &set);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pData the location to copy the address of the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateUnsignedBinaryIntegralSet(const size_t size, const std::vector<uint64_t> &set, T &value,
|
|
const void *&pData);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateUnsignedBinaryIntegralSet(const size_t size, const std::vector<uint64_t> &set, T &value);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
ACTIV_BASE_API StatusCode ValidateUnsignedBinaryIntegralCopy(const size_t size, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateUnsignedBinaryIntegralCopy(const size_t size, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateUnsignedBinaryIntegralRangeCopy(const size_t size, const uint64_t lower, const uint64_t upper, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param lower the lower bound value.
|
|
* @param upper the upper bound value.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateUnsignedBinaryIntegralRangeCopy(const size_t size, const uint64_t lower, const uint64_t upper, T &value,
|
|
void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN>
|
|
StatusCode ValidateUnsignedBinaryIntegralSetCopy(const size_t size, const std::vector<uint64_t> &set, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate an unsigned binary integral value and copy.
|
|
*
|
|
* @param size the size of the value.
|
|
* @param set the set of allowed values.
|
|
* @param value to receive the value.
|
|
* @param pCopy the address to copy the data to.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
StatusCode ValidateUnsignedBinaryIntegralSetCopy(const size_t size, const std::vector<uint64_t> &set, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Validate a binary boolean value.
|
|
*
|
|
* @param value to receive the boolean value.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
StatusCode ValidateBoolean(bool &value);
|
|
|
|
/**
|
|
* @brief Validate message.
|
|
*
|
|
* @param message message to deserialize. Must have a StatusCode Deserialize(MessageValidator &) method.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval ...
|
|
*/
|
|
template<typename MESSAGE_TYPE>
|
|
StatusCode ValidateMessage(MESSAGE_TYPE &message);
|
|
|
|
/**
|
|
* @brief Get data from the message.
|
|
*
|
|
* @param offset the offset within the message.
|
|
* @param pData reference to the address of the data.
|
|
* @param length the length to get.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_PARAMETER
|
|
*/
|
|
StatusCode Get(const size_t offset, const void *&pData, const size_t length) const;
|
|
|
|
/**
|
|
* @brief Copy an ASCII hexadecimal integral value to an unsigned binary integral value.
|
|
*
|
|
* @param to the value to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param size the size of the data to copy from.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
static StatusCode CopyAsciiHexadecimalIntegralToUnsignedBinaryIntegral(T &to, const void * const pData, size_t size);
|
|
|
|
/**
|
|
* @brief Copy a signed ASCII integral value to a signed binary integral value.
|
|
*
|
|
* @param to the value to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param length the length of the data to copy from.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
static StatusCode CopySignedAsciiIntegralToSignedBinaryIntegral(T &to, const void * const pData, size_t length);
|
|
|
|
/**
|
|
* @brief Copy a signed ASCII real value to a binary real.
|
|
*
|
|
* @param to the value to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param length the length of the data to copy from.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
static StatusCode CopySignedAsciiRealToBinaryReal(T &to, const void * const pData, size_t length);
|
|
|
|
/**
|
|
* @brief Copy a signed ASCII real value to a numerator and divisor.
|
|
*
|
|
* @param numerator the numerator to be copied to.
|
|
* @param divisor the divisor to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param length the length of the data to copy from.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API static StatusCode CopySignedAsciiRealToNumeratorAndDivisor(int64_t &numerator, uint64_t &divisor,
|
|
const void * const pData, const size_t length);
|
|
|
|
/**
|
|
* @brief Copy a signed binary integral value to a signed binary integral value.
|
|
*
|
|
* @param to the value to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param size the size of the data to copy from.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
static StatusCode CopySignedBinaryIntegralToSignedBinaryIntegral(T &to, const void * const pData, size_t size);
|
|
|
|
/**
|
|
* @brief Copy an unsigned ASCII integral value to an unsigned binary integral value.
|
|
*
|
|
* @param to the value to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param length the length of the data to copy from.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
static StatusCode CopyUnsignedAsciiIntegralToUnsignedBinaryIntegral(T &to, const void * const pData, size_t length);
|
|
|
|
/**
|
|
* @brief Copy an unsigned ASCII real value to a binary real.
|
|
*
|
|
* @param to the value to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param length the length of the data to copy from.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
static StatusCode CopyUnsignedAsciiRealToBinaryReal(T &to, const void * const pData, size_t length);
|
|
|
|
/**
|
|
* @brief Copy an unsigned ASCII real value to a numerator and divisor.
|
|
*
|
|
* @param numerator the numerator to be copied to.
|
|
* @param divisor the divisor to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param length the length of the data to copy from.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
ACTIV_BASE_API static StatusCode CopyUnsignedAsciiRealToNumeratorAndDivisor(uint64_t &numerator, uint64_t &divisor,
|
|
const void * const pData, const size_t length);
|
|
|
|
/**
|
|
* @brief Copy an unsigned binary integral value to an unsigned binary integral value.
|
|
*
|
|
* @param to the value to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param size the size of the data to copy from.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
static StatusCode CopyUnsignedBinaryIntegralToUnsignedBinaryIntegral(T &to, const void * const pData, size_t size);
|
|
|
|
private:
|
|
/**
|
|
* @brief Copy a signed ASCII integral value to a signed binary integral value.
|
|
*
|
|
* @param to the value to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param length the length of the data to copy from. Assumed to be not 0.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
static StatusCode CopySignedAsciiIntegralToSignedBinaryIntegralInternal(T &to, const void * const pData, size_t length);
|
|
|
|
/**
|
|
* @brief Copy a positive signed ASCII integral value to a signed binary integral value.
|
|
*
|
|
* @param to the value to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param length the length of the data to copy from.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
static StatusCode CopyPositiveAsciiIntegralToSignedBinaryIntegral(T &to, const void * const pData, size_t length);
|
|
|
|
/**
|
|
* @brief Copy a negative signed ASCII integral value to a signed binary integral value.
|
|
*
|
|
* @param to the value to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param length the length of the data to copy from.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
template <typename T>
|
|
static StatusCode CopyNegativeAsciiIntegralToSignedBinaryIntegral(T &to, const void * const pData, size_t length);
|
|
|
|
/**
|
|
* @brief Copy a signed ASCII real value to a numerator and divisor.
|
|
*
|
|
* @param numerator the numerator to be copied to.
|
|
* @param divisor the divisor to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param length the length of the data to copy from. Assumed to be not 0.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
static StatusCode CopySignedAsciiRealToNumeratorAndDivisorInternal(int64_t &numerator, uint64_t &divisor,
|
|
const void * const pData, const size_t length);
|
|
|
|
/**
|
|
* @brief Copy a positive ASCII real value to a numerator and divisor.
|
|
*
|
|
* @param numerator the numerator to be copied to.
|
|
* @param divisor the divisor to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param length the length of the data to copy from.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
static StatusCode CopyPositiveAsciiRealToNumeratorAndDivisor(int64_t &numerator, uint64_t &divisor, const void * const pData,
|
|
const size_t length);
|
|
|
|
/**
|
|
* @brief Copy a negative ASCII real value to a numerator and divisor.
|
|
*
|
|
* @param numerator the numerator to be copied to.
|
|
* @param divisor the divisor to be copied to.
|
|
* @param pData a pointer to the data to copy from.
|
|
* @param length the length of the data to copy from.
|
|
*
|
|
* @retval STATUS_CODE_SUCCESS
|
|
* @retval STATUS_CODE_INVALID_FORMAT
|
|
* @retval STATUS_CODE_OUT_OF_RANGE
|
|
*/
|
|
static StatusCode CopyNegativeAsciiRealToNumeratorAndDivisor(int64_t &numerator, uint64_t &divisor, const void * const pData,
|
|
const size_t length);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
static StatusCode CopySignedBinaryIntegralToSignedBinaryIntegralInternal(T &to, const void * const pData, size_t size);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
static StatusCode CopyUnsignedBinaryIntegralToUnsignedBinaryIntegralInternal(T &to, const void * const pData, size_t size);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateAsciiHexadecimalIntegralT(const size_t size, T &value,
|
|
const void *&pData);
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateAsciiHexadecimalIntegralT(const size_t size, T &value);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateAsciiHexadecimalIntegralRangeT(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, T &value, const void *&pData);
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateAsciiHexadecimalIntegralRangeT(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, T &value);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateAsciiHexadecimalIntegralSetT(const size_t size,
|
|
const std::vector<uint64_t> &set, T &value, const void *&pData);
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateAsciiHexadecimalIntegralSetT(const size_t size,
|
|
const std::vector<uint64_t> &set, T &value);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateAsciiHexadecimalIntegralCopyT(const size_t size, T &value, void *pCopy);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateAsciiHexadecimalIntegralRangeCopyT(const size_t size,
|
|
const uint64_t lower, const uint64_t upper, T &value, void *pCopy);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateAsciiHexadecimalIntegralSetCopyT(const size_t size,
|
|
const std::vector<uint64_t> &set, T &value, void *pCopy);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiIntegralT(const size_t length, T &value, const void *&pData);
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiIntegralT(const size_t length, T &value);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiIntegralRangeT(const size_t length, const int64_t lower,
|
|
const int64_t upper, T &value, const void *&pData);
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiIntegralRangeT(const size_t length, const int64_t lower,
|
|
const int64_t upper, T &value);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiIntegralSetT(const size_t length,
|
|
const std::vector<int64_t> &set, T &value, const void *&pData);
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiIntegralSetT(const size_t length,
|
|
const std::vector<int64_t> &set, T &value);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiIntegralCopyT(const size_t length, T &value, void *pCopy);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiIntegralRangeCopyT(const size_t length, const int64_t lower,
|
|
const int64_t upper, T &value, void *pCopy);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiIntegralSetCopyT(const size_t length,
|
|
const std::vector<int64_t> &set, T &value, void *pCopy);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiRealT(const size_t length, T &value, const void *&pData);
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiRealT(const size_t length, T &value);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiRealRangeT(const size_t length, const long double lower,
|
|
const long double upper, T &value, const void *&pData);
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiRealRangeT(const size_t length, const long double lower,
|
|
const long double upper, T &value);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiRealSetT(const size_t length,
|
|
const std::vector<long double> &set, T &value, const void *&pData);
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiRealSetT(const size_t length,
|
|
const std::vector<long double> &set, T &value);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiRealCopyT(const size_t length, T &value, void *pCopy);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiRealRangeCopyT(const size_t length, const long double lower,
|
|
const long double upper, T &value, void *pCopy);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedAsciiRealSetCopyT(const size_t length,
|
|
const std::vector<long double> &set, T &value, void *pCopy);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedBinaryIntegralT(const size_t size, T &value, const void *&pData);
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedBinaryIntegralT(const size_t size, T &value);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedBinaryIntegralRangeT(const size_t size, const int64_t lower,
|
|
const int64_t upper, T &value, const void *&pData);
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedBinaryIntegralRangeT(const size_t size, const int64_t lower,
|
|
const int64_t upper, T &value);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedBinaryIntegralSetT(const size_t size,
|
|
const std::vector<int64_t> &set, T &value, const void *&pData);
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedBinaryIntegralSetT(const size_t size,
|
|
const std::vector<int64_t> &set, T &value);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedBinaryIntegralCopyT(const size_t size, T &value, void *pCopy);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedBinaryIntegralRangeCopyT(const size_t size, const int64_t lower,
|
|
const int64_t upper, T &value, void *pCopy);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateSignedBinaryIntegralSetCopyT(const size_t size,
|
|
const std::vector<int64_t> &set, T &value, void *pCopy);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiIntegralT(const size_t length, T &value,
|
|
const void *&pData);
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiIntegralT(const size_t length, T &value);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiIntegralRangeT(const size_t length, const uint64_t lower,
|
|
const uint64_t upper, T &value, const void *&pData);
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiIntegralRangeT(const size_t length, const uint64_t lower,
|
|
const uint64_t upper, T &value);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiIntegralSetT(const size_t length,
|
|
const std::vector<uint64_t> &set, T &value, const void *&pData);
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiIntegralSetT(const size_t length,
|
|
const std::vector<uint64_t> &set, T &value);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiIntegralCopyT(const size_t length, T &value, void *pCopy);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiIntegralRangeCopyT(const size_t length, const uint64_t lower,
|
|
const uint64_t upper, T &value, void *pCopy);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiIntegralSetCopyT(const size_t length,
|
|
const std::vector<uint64_t> &set, T &value, void *pCopy);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiRealT(const size_t length, T &value, const void *&pData);
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiRealT(const size_t length, T &value);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiRealRangeT(const size_t length, const long double lower,
|
|
const long double upper, T &value, const void *&pData);
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiRealRangeT(const size_t length, const long double lower,
|
|
const long double upper, T &value);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiRealSetT(const size_t length,
|
|
const std::vector<long double> &set, T &value, const void *&pData);
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiRealSetT(const size_t length,
|
|
const std::vector<long double> &set, T &value);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiRealCopyT(const size_t length, T &value, void *pCopy);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiRealRangeCopyT(const size_t length, const long double lower,
|
|
const long double upper, T &value, void *pCopy);
|
|
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedAsciiRealSetCopyT(const size_t length,
|
|
const std::vector<long double> &set, T &value, void *pCopy);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedBinaryIntegralT(const size_t size, T &value, const void *&pData);
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedBinaryIntegralT(const size_t size, T &value);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedBinaryIntegralRangeT(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, T &value, const void *&pData);
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedBinaryIntegralRangeT(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, T &value);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedBinaryIntegralSetT(const size_t size,
|
|
const std::vector<uint64_t> &set, T &value, const void *&pData);
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedBinaryIntegralSetT(const size_t size,
|
|
const std::vector<uint64_t> &set, T &value);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedBinaryIntegralCopyT(const size_t size,
|
|
T &value, void *pCopy);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedBinaryIntegralRangeCopyT(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, T &value, void *pCopy);
|
|
|
|
template <Endian ENDIAN, typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_BASE_API) StatusCode ValidateUnsignedBinaryIntegralSetCopyT(const size_t size,
|
|
const std::vector<uint64_t> &set, T &value, void *pCopy);
|
|
|
|
/**
|
|
* @brief Template to get built-in type value from a (potentially) unaligned pointer and swap endian if required.
|
|
*
|
|
* ENDIAN source endian.
|
|
* T type of destination.
|
|
*/
|
|
template <Endian ENDIAN, typename T>
|
|
class GetValueFromUnalignedPointerInEndianT
|
|
{
|
|
};
|
|
|
|
/**
|
|
* @brief Template to copy binary to binary with template length.
|
|
*
|
|
* Note no definition of this template is provided - one of the partial specializations should be used.
|
|
*
|
|
* SIZE_MATCH used for partial specialization to optimize case when sizeof(T) == SIZE.
|
|
* IS_SIGNED used for partial specialization on signedness of T.
|
|
* SIZE number of bytes to copy.
|
|
* ENDIAN source endian.
|
|
* T type of destination.
|
|
*/
|
|
template <bool SIZE_MATCH, bool IS_SIGNED, size_t SIZE, Endian ENDIAN, typename T>
|
|
class CopyBinaryIntegralToBinaryIntegralT
|
|
{
|
|
};
|
|
|
|
/**
|
|
* @brief Template to copy binary to binary with run-time length.
|
|
*
|
|
* Note no definition of this template is provided - one of the partial specializations should be used.
|
|
*
|
|
* IS_SIGNED used for partial specialization on signedness of T.
|
|
* ENDIAN source endian.
|
|
* T type of destination.
|
|
*/
|
|
template <bool IS_SIGNED, Endian ENDIAN, typename T>
|
|
class CopyBinaryIntegralToBinaryIntegralRtlT
|
|
{
|
|
};
|
|
|
|
/**
|
|
* @brief Template to copy ascii hexadecimal to binary.
|
|
*
|
|
* Note no definition of this template is provided - one of the partial specializations should be used.
|
|
*
|
|
* ENDIAN source endian.
|
|
*/
|
|
template<Endian ENDIAN>
|
|
class CopyAsciiHexadecimalIntegralToUnsignedBinaryIntegralT
|
|
{
|
|
};
|
|
|
|
const byte_t * m_pMessage; ///< The address of the message.
|
|
const byte_t * m_pNext; ///< Next byte to be validated.
|
|
const byte_t * m_pMessageEnd; ///< The address of one byte passed the end of the message.
|
|
};
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline MessageValidator::MessageValidator(const void *pMessage, const size_t length, const MessageVersion messageVersion)
|
|
{
|
|
Initialize(pMessage, length, messageVersion);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline void MessageValidator::Initialize(const void *pMessage, const size_t length, const MessageVersion messageVersion)
|
|
{
|
|
m_pMessage = reinterpret_cast<const byte_t *>(pMessage);
|
|
m_pMessageEnd = m_pMessage + length;
|
|
|
|
Reset(messageVersion);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline void MessageValidator::Reset(const MessageVersion messageVersion)
|
|
{
|
|
SetMessageVersion(messageVersion);
|
|
m_pNext = m_pMessage;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline const void *MessageValidator::GetMessage() const
|
|
{
|
|
return m_pMessage;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline size_t MessageValidator::GetLength() const
|
|
{
|
|
return (m_pMessageEnd - m_pMessage);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline size_t MessageValidator::GetOffset() const
|
|
{
|
|
return (m_pNext - m_pMessage);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::SetOffset(const size_t offset)
|
|
{
|
|
const byte_t * const pNewNext = m_pMessage + offset;
|
|
|
|
if (ACTIV_UNLIKELY(pNewNext > m_pMessageEnd))
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
|
|
m_pNext = pNewNext;
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline bool MessageValidator::IsEndOfMessage() const
|
|
{
|
|
return (m_pNext == m_pMessageEnd);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateBytesRef(const size_t length, const void *&pData)
|
|
{
|
|
const byte_t * const pNewNext = m_pNext + length;
|
|
|
|
if (ACTIV_UNLIKELY(pNewNext > m_pMessageEnd))
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
|
|
pData = m_pNext;
|
|
m_pNext = pNewNext;
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateBytes(const size_t length)
|
|
{
|
|
const byte_t * const pNewNext = m_pNext + length;
|
|
|
|
if (ACTIV_UNLIKELY(pNewNext > m_pMessageEnd))
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
|
|
m_pNext = pNewNext;
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateBytes(const size_t length, const byte_t value, const void *&pData)
|
|
{
|
|
const byte_t * const pNewNext = m_pNext + length;
|
|
|
|
if (ACTIV_UNLIKELY(pNewNext > m_pMessageEnd))
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
|
|
for (const byte_t *pByte = m_pNext; pByte < pNewNext; ++pByte)
|
|
{
|
|
const byte_t thisByte(*pByte);
|
|
|
|
if (ACTIV_UNLIKELY(thisByte != value))
|
|
return STATUS_CODE_OUT_OF_RANGE;
|
|
}
|
|
|
|
pData = m_pNext;
|
|
m_pNext = pNewNext;
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateBytes(const size_t length, const byte_t value)
|
|
{
|
|
const byte_t * const pNewNext = m_pNext + length;
|
|
|
|
if (ACTIV_UNLIKELY(pNewNext > m_pMessageEnd))
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
|
|
for (const byte_t *pByte = m_pNext; pByte < pNewNext; ++pByte)
|
|
{
|
|
const byte_t thisByte(*pByte);
|
|
|
|
if (ACTIV_UNLIKELY(thisByte != value))
|
|
return STATUS_CODE_OUT_OF_RANGE;
|
|
}
|
|
|
|
m_pNext = pNewNext;
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<size_t SIZE, MessageValidator::Endian ENDIAN, typename T>
|
|
StatusCode MessageValidator::ValidateBinaryIntegral(T &value)
|
|
{
|
|
ACTIV_BOOST_STATIC_ASSERT((SIZE > 0) && (SIZE <= sizeof(uint64_t)));
|
|
ACTIV_BOOST_STATIC_ASSERT(Boost::is_integral<T>::value || Boost::is_enum<T>::value);
|
|
|
|
const byte_t * const pNewNext = m_pNext + SIZE;
|
|
|
|
if (ACTIV_UNLIKELY(pNewNext > m_pMessageEnd))
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
|
|
T to;
|
|
StatusCode statusCode =
|
|
CopyBinaryIntegralToBinaryIntegralT<(SIZE == sizeof(T)), Boost::is_signed<T>::value, SIZE, ENDIAN, T>()(m_pNext, to);
|
|
|
|
if (ACTIV_UNLIKELY(STATUS_CODE_SUCCESS != statusCode))
|
|
return statusCode;
|
|
|
|
m_pNext = pNewNext;
|
|
value = to;
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<typename T>
|
|
inline StatusCode MessageValidator::ValidateActivIntegral(T &value)
|
|
{
|
|
return ValidateBinaryIntegral<sizeof(T), MessageHandler::ENDIAN_LITTLE, T>(value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<size_t SIZE, MessageValidator::Endian ENDIAN, typename T, T LOWER, T UPPER>
|
|
StatusCode MessageValidator::ValidateBinaryIntegralRange(T &value)
|
|
{
|
|
ACTIV_BOOST_STATIC_ASSERT((SIZE > 0) && (SIZE <= sizeof(uint64_t)));
|
|
ACTIV_BOOST_STATIC_ASSERT(Boost::is_integral<T>::value);
|
|
|
|
const byte_t * const pNewNext = m_pNext + SIZE;
|
|
|
|
if (ACTIV_UNLIKELY(pNewNext > m_pMessageEnd))
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
|
|
T to;
|
|
StatusCode statusCode =
|
|
CopyBinaryIntegralToBinaryIntegralT<(SIZE == sizeof(T)), Boost::is_signed<T>::value, SIZE, ENDIAN, T>()(m_pNext, to);
|
|
|
|
if (ACTIV_UNLIKELY(STATUS_CODE_SUCCESS != statusCode))
|
|
return statusCode;
|
|
|
|
if (ACTIV_UNLIKELY((Less<T, LOWER>()(to))) || ACTIV_UNLIKELY((Greater<T, UPPER>()(to))))
|
|
return STATUS_CODE_OUT_OF_RANGE;
|
|
|
|
m_pNext = pNewNext;
|
|
value = to;
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<size_t SIZE, MessageValidator::Endian ENDIAN, typename T>
|
|
StatusCode MessageValidator::ValidateBinaryIntegralRange(const T lower, const T upper, T &value)
|
|
{
|
|
ACTIV_BOOST_STATIC_ASSERT((SIZE > 0) && (SIZE <= sizeof(uint64_t)));
|
|
ACTIV_BOOST_STATIC_ASSERT(Boost::is_integral<T>::value);
|
|
|
|
const byte_t * const pNewNext = m_pNext + SIZE;
|
|
|
|
if (ACTIV_UNLIKELY(pNewNext > m_pMessageEnd))
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
|
|
T to;
|
|
StatusCode statusCode =
|
|
CopyBinaryIntegralToBinaryIntegralT<(SIZE == sizeof(T)), Boost::is_signed<T>::value, SIZE, ENDIAN, T>()(m_pNext, to);
|
|
|
|
if (ACTIV_UNLIKELY(STATUS_CODE_SUCCESS != statusCode))
|
|
return statusCode;
|
|
|
|
if (ACTIV_UNLIKELY(to < lower) || ACTIV_UNLIKELY(to > upper))
|
|
return STATUS_CODE_OUT_OF_RANGE;
|
|
|
|
m_pNext = pNewNext;
|
|
value = to;
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegralRange(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, const void *&pData)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateAsciiHexadecimalIntegralRange<ENDIAN>(size, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegralRange(const size_t size, const uint64_t lower,
|
|
const uint64_t upper)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateAsciiHexadecimalIntegralRange<ENDIAN>(size, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegralSet(const size_t size, const std::vector<uint64_t> &set,
|
|
const void *&pData)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateAsciiHexadecimalIntegralSet<ENDIAN>(size, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegralSet(const size_t size, const std::vector<uint64_t> &set)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateAsciiHexadecimalIntegralSet<ENDIAN>(size, set, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegralRangeCopy(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, void *pCopy)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateAsciiHexadecimalIntegralRangeCopy<ENDIAN>(size, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegralSetCopy(const size_t size, const std::vector<uint64_t> &set,
|
|
void *pCopy)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateAsciiHexadecimalIntegralSetCopy<ENDIAN>(size, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegralRange(const size_t length, const int64_t lower, const int64_t upper,
|
|
const void *&pData)
|
|
{
|
|
int64_t value;
|
|
|
|
return ValidateSignedAsciiIntegralRange(length, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegralRange(const size_t length, const int64_t lower, const int64_t upper)
|
|
{
|
|
int64_t value;
|
|
|
|
return ValidateSignedAsciiIntegralRange(length, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegralSet(const size_t length, const std::vector<int64_t> &set,
|
|
const void *&pData)
|
|
{
|
|
int64_t value;
|
|
|
|
return ValidateSignedAsciiIntegralSet(length, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegralSet(const size_t length, const std::vector<int64_t> &set)
|
|
{
|
|
int64_t value;
|
|
|
|
return ValidateSignedAsciiIntegralSet(length, set, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegralRangeCopy(const size_t length, const int64_t lower,
|
|
const int64_t upper, void *pCopy)
|
|
{
|
|
int64_t value;
|
|
|
|
return ValidateSignedAsciiIntegralRangeCopy(length, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegralSetCopy(const size_t length, const std::vector<int64_t> &set,
|
|
void *pCopy)
|
|
{
|
|
int64_t value;
|
|
|
|
return ValidateSignedAsciiIntegralSetCopy(length, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiRealRange(const size_t length, const long double lower,
|
|
const long double upper, const void *&pData)
|
|
{
|
|
long double value;
|
|
|
|
return ValidateSignedAsciiRealRangeT(length, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiRealRange(const size_t length, const long double lower,
|
|
const long double upper)
|
|
{
|
|
long double value;
|
|
|
|
return ValidateSignedAsciiRealRangeT(length, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiRealSet(const size_t length, const std::vector<long double> &set,
|
|
const void *&pData)
|
|
{
|
|
long double value;
|
|
|
|
return ValidateSignedAsciiRealSetT(length, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiRealSet(const size_t length, const std::vector<long double> &set)
|
|
{
|
|
long double value;
|
|
|
|
return ValidateSignedAsciiRealSetT(length, set, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiRealRangeCopy(const size_t length, const long double lower,
|
|
const long double upper, void *pCopy)
|
|
{
|
|
long double value;
|
|
|
|
return ValidateSignedAsciiRealRangeCopyT(length, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiRealSetCopy(const size_t length, const std::vector<long double> &set,
|
|
void *pCopy)
|
|
{
|
|
long double value;
|
|
|
|
return ValidateSignedAsciiRealSetCopyT(length, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegralRange(const size_t size, const int64_t lower, const int64_t upper,
|
|
const void *&pData)
|
|
{
|
|
int64_t value;
|
|
|
|
return ValidateSignedBinaryIntegralRange<ENDIAN>(size, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegralRange(const size_t size, const int64_t lower, const int64_t upper)
|
|
{
|
|
int64_t value;
|
|
|
|
return ValidateSignedBinaryIntegralRange<ENDIAN>(size, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegralSet(const size_t size, const std::vector<int64_t> &set,
|
|
const void *&pData)
|
|
{
|
|
int64_t value;
|
|
|
|
return ValidateSignedBinaryIntegralSet<ENDIAN>(size, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegralSet(const size_t size, const std::vector<int64_t> &set)
|
|
{
|
|
int64_t value;
|
|
|
|
return ValidateSignedBinaryIntegralSet<ENDIAN>(size, set, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegralRangeCopy(const size_t size, const int64_t lower,
|
|
const int64_t upper, void *pCopy)
|
|
{
|
|
int64_t value;
|
|
|
|
return ValidateSignedBinaryIntegralRangeCopy<ENDIAN>(size, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegralSetCopy(const size_t size, const std::vector<int64_t> &set,
|
|
void *pCopy)
|
|
{
|
|
int64_t value;
|
|
|
|
return ValidateSignedBinaryIntegralSetCopy<ENDIAN>(size, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
#if (ACTIV_CPLUSPLUS >= ACTIV_CPLUSPLUS_11)
|
|
template<typename T>
|
|
#endif
|
|
inline StatusCode MessageValidator::ValidateString(CxxYZ::string_view &stringView)
|
|
{
|
|
#if (ACTIV_CPLUSPLUS >= ACTIV_CPLUSPLUS_11)
|
|
typedef T StringLength;
|
|
#else
|
|
typedef DefaultStringLength StringLength;
|
|
#endif
|
|
|
|
const byte_t *pNewNext = m_pNext + sizeof(StringLength);
|
|
|
|
if (ACTIV_UNLIKELY(pNewNext > m_pMessageEnd))
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
|
|
size_t length;
|
|
ACTIV_RETURN_RESULT_IF_UNLIKELY(STATUS_CODE_SUCCESS, !=,
|
|
CopyUnsignedBinaryIntegralToUnsignedBinaryIntegral<ENDIAN_LITTLE>(length, m_pNext, sizeof(StringLength)));
|
|
|
|
const byte_t *pBody = pNewNext;
|
|
|
|
pNewNext += length;
|
|
|
|
if (ACTIV_UNLIKELY(pNewNext > m_pMessageEnd))
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
|
|
stringView = CxxYZ::string_view(reinterpret_cast<const char *>(pBody), length);
|
|
|
|
m_pNext = pNewNext;
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegralRange(const size_t length, const uint64_t lower,
|
|
const uint64_t upper, const void *&pData)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateUnsignedAsciiIntegralRange(length, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegralRange(const size_t length, const uint64_t lower,
|
|
const uint64_t upper)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateUnsignedAsciiIntegralRange(length, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegralSet(const size_t length, const std::vector<uint64_t> &set,
|
|
const void *&pData)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateUnsignedAsciiIntegralSet(length, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegralSet(const size_t length, const std::vector<uint64_t> &set)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateUnsignedAsciiIntegralSet(length, set, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegralRangeCopy(const size_t length, const uint64_t lower,
|
|
const uint64_t upper, void *pCopy)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateUnsignedAsciiIntegralRangeCopy(length, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegralSetCopy(const size_t length, const std::vector<uint64_t> &set,
|
|
void *pCopy)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateUnsignedAsciiIntegralSetCopy(length, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiRealRange(const size_t length, const long double lower,
|
|
const long double upper, const void *&pData)
|
|
{
|
|
long double value;
|
|
|
|
return ValidateUnsignedAsciiRealRange(length, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiRealRange(const size_t length, const long double lower,
|
|
const long double upper)
|
|
{
|
|
long double value;
|
|
|
|
return ValidateUnsignedAsciiRealRange(length, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiRealSet(const size_t length, const std::vector<long double> &set,
|
|
const void *&pData)
|
|
{
|
|
long double value;
|
|
|
|
return ValidateUnsignedAsciiRealSet(length, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiRealSet(const size_t length, const std::vector<long double> &set)
|
|
{
|
|
long double value;
|
|
|
|
return ValidateUnsignedAsciiRealSet(length, set, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiRealRangeCopy(const size_t length, const long double lower,
|
|
const long double upper, void *pCopy)
|
|
{
|
|
long double value;
|
|
|
|
return ValidateUnsignedAsciiRealRangeCopy(length, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiRealSetCopy(const size_t length, const std::vector<long double> &set,
|
|
void *pCopy)
|
|
{
|
|
long double value;
|
|
|
|
return ValidateUnsignedAsciiRealSetCopy(length, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegralRange(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, const void *&pData)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateUnsignedBinaryIntegralRange<ENDIAN>(size, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegralRange(const size_t size, const uint64_t lower,
|
|
const uint64_t upper)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateUnsignedBinaryIntegralRange<ENDIAN>(size, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegralSet(const size_t size, const std::vector<uint64_t> &set,
|
|
const void *&pData)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateUnsignedBinaryIntegralSet<ENDIAN>(size, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegralSet(const size_t size, const std::vector<uint64_t> &set)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateUnsignedBinaryIntegralSet<ENDIAN>(size, set, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegralRangeCopy(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, void *pCopy)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateUnsignedBinaryIntegralRangeCopy<ENDIAN>(size, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegralSetCopy(const size_t size, const std::vector<uint64_t> &set,
|
|
void *pCopy)
|
|
{
|
|
uint64_t value;
|
|
|
|
return ValidateUnsignedBinaryIntegralSetCopy<ENDIAN>(size, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::ValidateBoolean(bool &value)
|
|
{
|
|
uint8_t tempValue;
|
|
|
|
ACTIV_RETURN_RESULT_IF_UNLIKELY(STATUS_CODE_SUCCESS, !=, (ValidateBinaryIntegral<sizeof(uint8_t), ENDIAN_LITTLE>(tempValue)));
|
|
|
|
value = (0 != tempValue);
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<typename MESSAGE_TYPE>
|
|
inline StatusCode MessageValidator::ValidateMessage(MESSAGE_TYPE &message)
|
|
{
|
|
return message.Deserialize(*this);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline StatusCode MessageValidator::Get(const size_t offset, const void *&pData, const size_t length) const
|
|
{
|
|
if (ACTIV_UNLIKELY(0 == length))
|
|
return STATUS_CODE_SUCCESS;
|
|
|
|
const byte_t * const pReturnedData = m_pMessage + offset;
|
|
|
|
if (ACTIV_UNLIKELY((pReturnedData + length) > m_pMessageEnd))
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
|
|
pData = pReturnedData;
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
StatusCode MessageValidator::CopyAsciiHexadecimalIntegralToUnsignedBinaryIntegral(T &to, const void * const pData, size_t size)
|
|
{
|
|
if (ACTIV_UNLIKELY(0 != (size % 2)) || ACTIV_UNLIKELY(size > (2 * sizeof(uint64_t))))
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
|
|
uint64_t value;
|
|
|
|
try
|
|
{
|
|
value = CopyAsciiHexadecimalIntegralToUnsignedBinaryIntegralT<ENDIAN>()(pData, size);
|
|
}
|
|
catch (const StatusCode statusCode)
|
|
{
|
|
return statusCode;
|
|
}
|
|
|
|
if (ACTIV_UNLIKELY(value > Boost::integer_traits<T>::const_max))
|
|
return STATUS_CODE_OUT_OF_RANGE;
|
|
|
|
to = static_cast<T>(value);
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
StatusCode MessageValidator::CopySignedAsciiIntegralToSignedBinaryIntegral(T &to, const void * const pData, size_t length)
|
|
{
|
|
if (ACTIV_LIKELY(length > 0))
|
|
{
|
|
return CopySignedAsciiIntegralToSignedBinaryIntegralInternal(to, pData, length);
|
|
}
|
|
else
|
|
{
|
|
to = 0;
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
StatusCode MessageValidator::CopySignedAsciiRealToBinaryReal(T &to, const void * const pData, size_t length)
|
|
{
|
|
int64_t numerator;
|
|
uint64_t divisor;
|
|
ACTIV_RETURN_RESULT_IF_UNLIKELY(STATUS_CODE_SUCCESS, !=,
|
|
CopySignedAsciiRealToNumeratorAndDivisor(numerator, divisor, pData, length));
|
|
|
|
to = static_cast<T>(numerator) / static_cast<T>(divisor);
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::CopySignedAsciiIntegralToSignedBinaryIntegralInternal(T &to, const void * const pData,
|
|
size_t length)
|
|
{
|
|
assert(length > 0);
|
|
const byte_t * const pDataBuffer = static_cast<const byte_t * const>(pData);
|
|
const byte_t firstByte(*pDataBuffer);
|
|
|
|
if (ACTIV_LIKELY('-' != firstByte))
|
|
{
|
|
if ('+' == firstByte)
|
|
return CopyPositiveAsciiIntegralToSignedBinaryIntegral(to, pDataBuffer + 1, length - 1);
|
|
else
|
|
return CopyPositiveAsciiIntegralToSignedBinaryIntegral(to, pDataBuffer, length);
|
|
}
|
|
else
|
|
{
|
|
return CopyNegativeAsciiIntegralToSignedBinaryIntegral(to, pDataBuffer + 1, length - 1);
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
StatusCode MessageValidator::CopyPositiveAsciiIntegralToSignedBinaryIntegral(T &to, const void * const pData, size_t length)
|
|
{
|
|
const byte_t *pByte = static_cast<const byte_t * const>(pData);
|
|
const byte_t * const pEnd = pByte + length;
|
|
int64_t value = 0;
|
|
|
|
if (ACTIV_LIKELY(length <= static_cast<size_t>(Boost::integer_traits<int64_t>::digits10)))
|
|
{
|
|
for (; pByte < pEnd; ++pByte)
|
|
{
|
|
const byte_t thisDigit(*pByte - byte_t('0'));
|
|
|
|
if (ACTIV_LIKELY(thisDigit <= 9))
|
|
value = (value * 10) + static_cast<int64_t>(thisDigit);
|
|
else
|
|
return STATUS_CODE_INVALID_FORMAT;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
for (size_t i = 0; pByte < pEnd; ++pByte, ++i)
|
|
{
|
|
const byte_t thisDigit(*pByte - byte_t('0'));
|
|
|
|
if (ACTIV_LIKELY(thisDigit <= 9))
|
|
{
|
|
if (ACTIV_UNLIKELY(i >= static_cast<size_t>(Boost::integer_traits<int64_t>::digits10)))
|
|
{
|
|
if (ACTIV_UNLIKELY(
|
|
value > ((Boost::integer_traits<int64_t>::const_max - static_cast<int64_t>(thisDigit)) / 10)))
|
|
{
|
|
return STATUS_CODE_OUT_OF_RANGE;
|
|
}
|
|
}
|
|
|
|
value = (value * 10) + static_cast<int64_t>(thisDigit);
|
|
}
|
|
else
|
|
{
|
|
return STATUS_CODE_INVALID_FORMAT;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (ACTIV_UNLIKELY(value > Boost::integer_traits<T>::const_max))
|
|
return STATUS_CODE_OUT_OF_RANGE;
|
|
|
|
to = static_cast<T>(value);
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
StatusCode MessageValidator::CopyNegativeAsciiIntegralToSignedBinaryIntegral(T &to, const void * const pData, size_t length)
|
|
{
|
|
const byte_t *pByte = static_cast<const byte_t * const>(pData);
|
|
const byte_t * const pEnd = pByte + length;
|
|
int64_t value = 0;
|
|
|
|
if (ACTIV_LIKELY(length <= static_cast<size_t>(Boost::integer_traits<int64_t>::digits10)))
|
|
{
|
|
for (size_t i = 0; pByte < pEnd; ++pByte, ++i)
|
|
{
|
|
const byte_t thisDigit(*pByte - byte_t('0'));
|
|
|
|
if (ACTIV_LIKELY(thisDigit <= 9))
|
|
value = (value * 10) - static_cast<int64_t>(thisDigit);
|
|
else
|
|
return STATUS_CODE_INVALID_FORMAT;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
for (size_t i = 0; i < length; ++i)
|
|
{
|
|
const byte_t thisDigit(*pByte - byte_t('0'));
|
|
|
|
if (ACTIV_LIKELY(thisDigit <= 9))
|
|
{
|
|
if (ACTIV_UNLIKELY(i >= static_cast<size_t>(Boost::integer_traits<int64_t>::digits10)))
|
|
{
|
|
if (ACTIV_UNLIKELY(
|
|
value < ((Boost::integer_traits<int64_t>::const_min + static_cast<int64_t>(thisDigit)) / 10)))
|
|
{
|
|
return STATUS_CODE_OUT_OF_RANGE;
|
|
}
|
|
}
|
|
|
|
value = (value * 10) - static_cast<int64_t>(thisDigit);
|
|
}
|
|
else
|
|
{
|
|
return STATUS_CODE_INVALID_FORMAT;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (ACTIV_UNLIKELY(value < Boost::integer_traits<T>::const_min))
|
|
return STATUS_CODE_OUT_OF_RANGE;
|
|
|
|
to = static_cast<T>(value);
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::CopySignedBinaryIntegralToSignedBinaryIntegral(T &to, const void * const pData, size_t size)
|
|
{
|
|
return CopyBinaryIntegralToBinaryIntegralRtlT<true, ENDIAN, T>()(pData, size, to);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
StatusCode MessageValidator::CopyUnsignedAsciiIntegralToUnsignedBinaryIntegral(T &to, const void * const pData, size_t length)
|
|
{
|
|
const byte_t * const pDataBuffer = static_cast<const byte_t * const>(pData);
|
|
uint64_t value = 0;
|
|
|
|
// If fewer digits than the maximum digits in a uint64_t, then we know we can't overflow.
|
|
if (ACTIV_LIKELY(length <= static_cast<size_t>(Boost::integer_traits<uint64_t>::digits10)))
|
|
{
|
|
for (size_t i = 0; i < length; ++i)
|
|
{
|
|
const byte_t thisDigit = pDataBuffer[i] - byte_t('0');
|
|
|
|
if (ACTIV_LIKELY(thisDigit <= 9))
|
|
value = (value * 10) + static_cast<uint64_t>(thisDigit);
|
|
else
|
|
return STATUS_CODE_INVALID_FORMAT;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
for (size_t i = 0; i < length; ++i)
|
|
{
|
|
const byte_t thisDigit = pDataBuffer[i] - byte_t('0');
|
|
const uint64_t oldValue = value;
|
|
|
|
if (ACTIV_LIKELY(thisDigit <= 9))
|
|
value = (value * 10) + static_cast<uint64_t>(thisDigit);
|
|
else
|
|
return STATUS_CODE_INVALID_FORMAT;
|
|
|
|
if (ACTIV_UNLIKELY(value < oldValue))
|
|
return STATUS_CODE_OUT_OF_RANGE;
|
|
}
|
|
}
|
|
|
|
if (ACTIV_UNLIKELY(value > Boost::integer_traits<T>::const_max))
|
|
return STATUS_CODE_OUT_OF_RANGE;
|
|
|
|
to = static_cast<T>(value);
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
StatusCode MessageValidator::CopyUnsignedAsciiRealToBinaryReal(T &to, const void * const pData, size_t length)
|
|
{
|
|
uint64_t numerator;
|
|
uint64_t divisor;
|
|
ACTIV_RETURN_RESULT_IF_UNLIKELY(STATUS_CODE_SUCCESS, !=,
|
|
CopyUnsignedAsciiRealToNumeratorAndDivisor(numerator, divisor, pData, length));
|
|
|
|
to = static_cast<T>(numerator) / static_cast<T>(divisor);
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
StatusCode MessageValidator::CopyUnsignedBinaryIntegralToUnsignedBinaryIntegral(T &to, const void * const pData, size_t size)
|
|
{
|
|
return CopyBinaryIntegralToBinaryIntegralRtlT<false, ENDIAN, T>()(pData, size, to);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
StatusCode MessageValidator::CopySignedBinaryIntegralToSignedBinaryIntegralInternal(T &to, const void * const pData, size_t size)
|
|
{
|
|
ACTIV_BOOST_STATIC_ASSERT(Boost::is_signed<T>::value);
|
|
|
|
if (ACTIV_LIKELY(size <= sizeof(T)))
|
|
{
|
|
// Fast path when we can guarantee the value will fit in the target.
|
|
switch (size)
|
|
{
|
|
case sizeof(int8_t):
|
|
to = static_cast<T>(GetValueFromUnalignedPointerInEndianT<ENDIAN, int8_t>()(pData));
|
|
return STATUS_CODE_SUCCESS;
|
|
|
|
case sizeof(int16_t):
|
|
to = static_cast<T>(GetValueFromUnalignedPointerInEndianT<ENDIAN, int16_t>()(pData));
|
|
return STATUS_CODE_SUCCESS;
|
|
|
|
case sizeof(int32_t):
|
|
to = static_cast<T>(GetValueFromUnalignedPointerInEndianT<ENDIAN, int32_t>()(pData));
|
|
return STATUS_CODE_SUCCESS;
|
|
|
|
case sizeof(int64_t):
|
|
to = static_cast<T>(GetValueFromUnalignedPointerInEndianT<ENDIAN, int64_t>()(pData));
|
|
return STATUS_CODE_SUCCESS;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
else if (ACTIV_UNLIKELY(size > sizeof(int64_t)))
|
|
{
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
}
|
|
|
|
const byte_t * const pDataBuffer = static_cast<const byte_t * const>(pData);
|
|
int64_t value = 0;
|
|
|
|
if (ENDIAN_LITTLE == ENDIAN)
|
|
{
|
|
for (size_t i = 0; i < size; ++i)
|
|
{
|
|
value |= static_cast<int64_t>(pDataBuffer[i]) << (i * CHAR_BIT);
|
|
}
|
|
}
|
|
else // (ENDIAN_BIG == ENDIAN)
|
|
{
|
|
for (size_t i = 0; i < size; ++i)
|
|
{
|
|
value |= static_cast<int64_t>(pDataBuffer[i]) << ((size - i - 1) * CHAR_BIT);
|
|
}
|
|
}
|
|
|
|
if ((sizeof(int64_t) != size) && (value & (INT64_C(1) << (((size - 1) * CHAR_BIT) + (CHAR_BIT - 1)))))
|
|
{
|
|
#if (defined ACTIV_COMPILER_GCC) && (ACTIV_GCC_COMPILER_VERSION >= ACTIV_MAKE_GCC_COMPILER_VERSION(9, 0))
|
|
#pragma GCC diagnostic push
|
|
#pragma GCC diagnostic ignored "-Wshift-negative-value"
|
|
#endif
|
|
value |= ((INT64_C(-1) >> ((sizeof(int64_t) - size) * CHAR_BIT)) << (size * CHAR_BIT));
|
|
#if (defined ACTIV_COMPILER_GCC) && (ACTIV_GCC_COMPILER_VERSION >= ACTIV_MAKE_GCC_COMPILER_VERSION(9, 0))
|
|
#pragma GCC diagnostic pop
|
|
#endif
|
|
}
|
|
|
|
if (ACTIV_UNLIKELY(value < Boost::integer_traits<T>::const_min) || ACTIV_UNLIKELY(value > Boost::integer_traits<T>::const_max))
|
|
return STATUS_CODE_OUT_OF_RANGE;
|
|
|
|
to = static_cast<T>(value);
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
StatusCode MessageValidator::CopyUnsignedBinaryIntegralToUnsignedBinaryIntegralInternal(T &to, const void * const pData,
|
|
size_t size)
|
|
{
|
|
ACTIV_BOOST_STATIC_ASSERT(!Boost::is_signed<T>::value);
|
|
|
|
if (ACTIV_LIKELY(size <= sizeof(T)))
|
|
{
|
|
// Fast path when we can guarantee the value will fit in the target.
|
|
switch (size)
|
|
{
|
|
case sizeof(uint8_t):
|
|
to = static_cast<T>(GetValueFromUnalignedPointerInEndianT<ENDIAN, uint8_t>()(pData));
|
|
return STATUS_CODE_SUCCESS;
|
|
|
|
case sizeof(uint16_t):
|
|
to = static_cast<T>(GetValueFromUnalignedPointerInEndianT<ENDIAN, uint16_t>()(pData));
|
|
return STATUS_CODE_SUCCESS;
|
|
|
|
case sizeof(uint32_t):
|
|
to = static_cast<T>(GetValueFromUnalignedPointerInEndianT<ENDIAN, uint32_t>()(pData));
|
|
return STATUS_CODE_SUCCESS;
|
|
|
|
case sizeof(uint64_t):
|
|
to = static_cast<T>(GetValueFromUnalignedPointerInEndianT<ENDIAN, uint64_t>()(pData));
|
|
return STATUS_CODE_SUCCESS;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
else if (ACTIV_UNLIKELY(size > sizeof(uint64_t)))
|
|
{
|
|
return STATUS_CODE_INVALID_PARAMETER;
|
|
}
|
|
|
|
const byte_t * const pDataBuffer = static_cast<const byte_t * const>(pData);
|
|
uint64_t value = 0;
|
|
|
|
if (ENDIAN_LITTLE == ENDIAN)
|
|
{
|
|
for (size_t i = 0; i < size; ++i)
|
|
{
|
|
value |= static_cast<uint64_t>(pDataBuffer[i]) << (i * CHAR_BIT);
|
|
}
|
|
}
|
|
else // (ENDIAN_BIG == ENDIAN)
|
|
{
|
|
for (size_t i = 0; i < size; ++i)
|
|
{
|
|
value |= static_cast<uint64_t>(pDataBuffer[i]) << ((size - i - 1) * CHAR_BIT);
|
|
}
|
|
}
|
|
|
|
if (ACTIV_UNLIKELY(value > Boost::integer_traits<T>::const_max))
|
|
return STATUS_CODE_OUT_OF_RANGE;
|
|
|
|
to = static_cast<T>(value);
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegral(const size_t size, T &value, const void *&pData)
|
|
{
|
|
return ValidateAsciiHexadecimalIntegralT<ENDIAN, T>(size, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegral(const size_t size, T &value)
|
|
{
|
|
return ValidateAsciiHexadecimalIntegralT<ENDIAN, T>(size, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegralRange(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, T &value, const void *&pData)
|
|
{
|
|
return ValidateAsciiHexadecimalIntegralRangeT<ENDIAN, T>(size, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegralRange(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, T &value)
|
|
{
|
|
return ValidateAsciiHexadecimalIntegralRangeT<ENDIAN, T>(size, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegralSet(const size_t size, const std::vector<uint64_t> &set,
|
|
T &value, const void *&pData)
|
|
{
|
|
return ValidateAsciiHexadecimalIntegralSetT<ENDIAN, T>(size, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegralSet(const size_t size, const std::vector<uint64_t> &set,
|
|
T &value)
|
|
{
|
|
return ValidateAsciiHexadecimalIntegralSetT<ENDIAN, T>(size, set, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegralCopy(const size_t size, T &value, void *pCopy)
|
|
{
|
|
return ValidateAsciiHexadecimalIntegralCopyT<ENDIAN, T>(size, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegralRangeCopy(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, T &value, void *pCopy)
|
|
{
|
|
return ValidateAsciiHexadecimalIntegralRangeCopyT<ENDIAN, T>(size, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateAsciiHexadecimalIntegralSetCopy(const size_t size, const std::vector<uint64_t> &set,
|
|
T &value, void *pCopy)
|
|
{
|
|
return ValidateAsciiHexadecimalIntegralSetCopyT<ENDIAN, T>(size, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegral(const size_t length, T &value, const void *&pData)
|
|
{
|
|
return ValidateSignedAsciiIntegralT<T>(length, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegral(const size_t length, T &value)
|
|
{
|
|
return ValidateSignedAsciiIntegralT<T>(length, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegralRange(const size_t length, const int64_t lower, const int64_t upper,
|
|
T &value, const void *&pData)
|
|
{
|
|
return ValidateSignedAsciiIntegralRangeT<T>(length, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegralRange(const size_t length, const int64_t lower, const int64_t upper,
|
|
T &value)
|
|
{
|
|
return ValidateSignedAsciiIntegralRangeT<T>(length, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegralSet(const size_t length, const std::vector<int64_t> &set, T &value,
|
|
const void *&pData)
|
|
{
|
|
return ValidateSignedAsciiIntegralSetT<T>(length, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegralSet(const size_t length, const std::vector<int64_t> &set, T &value)
|
|
{
|
|
return ValidateSignedAsciiIntegralSetT<T>(length, set, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegralCopy(const size_t length, T &value, void *pCopy)
|
|
{
|
|
return ValidateSignedAsciiIntegralCopyT<T>(length, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegralRangeCopy(const size_t length, const int64_t lower,
|
|
const int64_t upper, T &value, void *pCopy)
|
|
{
|
|
return ValidateSignedAsciiIntegralRangeCopyT<T>(length, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiIntegralSetCopy(const size_t length, const std::vector<int64_t> &set,
|
|
T &value, void *pCopy)
|
|
{
|
|
return ValidateSignedAsciiIntegralSetCopyT<T>(length, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiReal(const size_t length, T &value, const void *&pData)
|
|
{
|
|
return ValidateSignedAsciiRealT<T>(length, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiReal(const size_t length, T &value)
|
|
{
|
|
return ValidateSignedAsciiRealT<T>(length, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiRealRange(const size_t length, const long double lower,
|
|
const long double upper, T &value, const void *&pData)
|
|
{
|
|
return ValidateSignedAsciiRealRangeT<T>(length, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiRealRange(const size_t length, const long double lower,
|
|
const long double upper, T &value)
|
|
{
|
|
return ValidateSignedAsciiRealRangeT<T>(length, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiRealSet(const size_t length, const std::vector<long double> &set, T &value,
|
|
const void *&pData)
|
|
{
|
|
return ValidateSignedAsciiRealSetT<T>(length, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiRealSet(const size_t length, const std::vector<long double> &set, T &value)
|
|
{
|
|
return ValidateSignedAsciiRealSetT<T>(length, set, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiRealCopy(const size_t length, T &value, void *pCopy)
|
|
{
|
|
return ValidateSignedAsciiRealCopyT<T>(length, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiRealRangeCopy(const size_t length, const long double lower,
|
|
const long double upper, T &value, void *pCopy)
|
|
{
|
|
return ValidateSignedAsciiRealRangeCopyT<T>(length, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedAsciiRealSetCopy(const size_t length, const std::vector<long double> &set,
|
|
T &value, void *pCopy)
|
|
{
|
|
return ValidateSignedAsciiRealSetCopyT<T>(length, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegral(const size_t size, T &value, const void *&pData)
|
|
{
|
|
return ValidateSignedBinaryIntegralT<ENDIAN, T>(size, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegral(const size_t size, T &value)
|
|
{
|
|
return ValidateSignedBinaryIntegralT<ENDIAN, T>(size, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegralRange(const size_t size, const int64_t lower, const int64_t upper,
|
|
T &value, const void *&pData)
|
|
{
|
|
return ValidateSignedBinaryIntegralRangeT<ENDIAN, T>(size, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegralRange(const size_t size, const int64_t lower, const int64_t upper,
|
|
T &value)
|
|
{
|
|
return ValidateSignedBinaryIntegralRangeT<ENDIAN, T>(size, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegralSet(const size_t size, const std::vector<int64_t> &set,
|
|
T &value, const void *&pData)
|
|
{
|
|
return ValidateSignedBinaryIntegralSetT<ENDIAN, T>(size, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegralSet(const size_t size, const std::vector<int64_t> &set,
|
|
T &value)
|
|
{
|
|
return ValidateSignedBinaryIntegralSetT<ENDIAN, T>(size, set, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegralCopy(const size_t size, T &value, void *pCopy)
|
|
{
|
|
return ValidateSignedBinaryIntegralCopyT<ENDIAN, T>(size, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegralRangeCopy(const size_t size, const int64_t lower,
|
|
const int64_t upper, T &value, void *pCopy)
|
|
{
|
|
return ValidateSignedBinaryIntegralRangeCopyT<ENDIAN, T>(size, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateSignedBinaryIntegralSetCopy(const size_t size, const std::vector<int64_t> &set,
|
|
T &value, void *pCopy)
|
|
{
|
|
return ValidateSignedBinaryIntegralSetCopyT<ENDIAN, T>(size, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegral(const size_t length, T &value, const void *&pData)
|
|
{
|
|
return ValidateUnsignedAsciiIntegralT<T>(length, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegral(const size_t length, T &value)
|
|
{
|
|
return ValidateUnsignedAsciiIntegralT<T>(length, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegralRange(const size_t length, const uint64_t lower,
|
|
const uint64_t upper, T &value, const void *&pData)
|
|
{
|
|
return ValidateUnsignedAsciiIntegralRangeT<T>(length, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegralRange(const size_t length, const uint64_t lower,
|
|
const uint64_t upper, T &value)
|
|
{
|
|
return ValidateUnsignedAsciiIntegralRangeT<T>(length, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegralSet(const size_t length, const std::vector<uint64_t> &set,
|
|
T &value, const void *&pData)
|
|
{
|
|
return ValidateUnsignedAsciiIntegralSetT<T>(length, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegralSet(const size_t length, const std::vector<uint64_t> &set,
|
|
T &value)
|
|
{
|
|
return ValidateUnsignedAsciiIntegralSetT<T>(length, set, value);
|
|
}
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegralCopy(const size_t length, T &value, void *pCopy)
|
|
{
|
|
return ValidateUnsignedAsciiIntegralCopyT<T>(length, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegralRangeCopy(const size_t length, const uint64_t lower,
|
|
const uint64_t upper, T &value, void *pCopy)
|
|
{
|
|
return ValidateUnsignedAsciiIntegralRangeCopyT<T>(length, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiIntegralSetCopy(const size_t length, const std::vector<uint64_t> &set,
|
|
T &value, void *pCopy)
|
|
{
|
|
return ValidateUnsignedAsciiIntegralSetCopyT<T>(length, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiReal(const size_t length, T &value, const void *&pData)
|
|
{
|
|
return ValidateUnsignedAsciiRealT<T>(length, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiReal(const size_t length, T &value)
|
|
{
|
|
return ValidateUnsignedAsciiRealT<T>(length, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiRealRange(const size_t length, const long double lower,
|
|
const long double upper, T &value, const void *&pData)
|
|
{
|
|
return ValidateUnsignedAsciiRealRangeT<T>(length, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiRealRange(const size_t length, const long double lower,
|
|
const long double upper, T &value)
|
|
{
|
|
return ValidateUnsignedAsciiRealRangeT<T>(length, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiRealSet(const size_t length, const std::vector<long double> &set, T &value,
|
|
const void *&pData)
|
|
{
|
|
return ValidateUnsignedAsciiRealSetT<T>(length, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiRealSet(const size_t length, const std::vector<long double> &set, T &value)
|
|
{
|
|
return ValidateUnsignedAsciiRealSetT<T>(length, set, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiRealCopy(const size_t length, T &value, void *pCopy)
|
|
{
|
|
return ValidateUnsignedAsciiRealCopyT<T>(length, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiRealRangeCopy(const size_t length, const long double lower,
|
|
const long double upper, T &value, void *pCopy)
|
|
{
|
|
return ValidateUnsignedAsciiRealRangeCopyT<T>(length, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedAsciiRealSetCopy(const size_t length, const std::vector<long double> &set,
|
|
T &value, void *pCopy)
|
|
{
|
|
return ValidateUnsignedAsciiRealSetCopyT<T>(length, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegral(const size_t size, T &value, const void *&pData)
|
|
{
|
|
return ValidateUnsignedBinaryIntegralT<ENDIAN, T>(size, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegral(const size_t size, T &value)
|
|
{
|
|
return ValidateUnsignedBinaryIntegralT<ENDIAN, T>(size, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegralRange(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, T &value, const void *&pData)
|
|
{
|
|
return ValidateUnsignedBinaryIntegralRangeT<ENDIAN, T>(size, lower, upper, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegralRange(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, T &value)
|
|
{
|
|
return ValidateUnsignedBinaryIntegralRangeT<ENDIAN, T>(size, lower, upper, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegralSet(const size_t size, const std::vector<uint64_t> &set,
|
|
T &value, const void *&pData)
|
|
{
|
|
return ValidateUnsignedBinaryIntegralSetT<ENDIAN, T>(size, set, value, pData);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegralSet(const size_t size, const std::vector<uint64_t> &set, T &value)
|
|
{
|
|
return ValidateUnsignedBinaryIntegralSetT<ENDIAN, T>(size, set, value);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegralCopy(const size_t size, T &value, void *pCopy)
|
|
{
|
|
return ValidateUnsignedBinaryIntegralCopyT<ENDIAN, T>(size, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegralRangeCopy(const size_t size, const uint64_t lower,
|
|
const uint64_t upper, T &value, void *pCopy)
|
|
{
|
|
return ValidateUnsignedBinaryIntegralRangeCopyT<ENDIAN, T>(size, lower, upper, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
inline StatusCode MessageValidator::ValidateUnsignedBinaryIntegralSetCopy(const size_t size, const std::vector<uint64_t> &set,
|
|
T &value, void *pCopy)
|
|
{
|
|
return ValidateUnsignedBinaryIntegralSetCopyT<ENDIAN, T>(size, set, value, pCopy);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
class MessageValidator::GetValueFromUnalignedPointerInEndianT<MessageValidator::ENDIAN_LOCAL, T>
|
|
{
|
|
public:
|
|
T operator()(const void * const pData) const
|
|
{
|
|
return GetValueFromUnalignedPointer<T>(pData);
|
|
}
|
|
};
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <typename T>
|
|
class MessageValidator::GetValueFromUnalignedPointerInEndianT<MessageValidator::ENDIAN_ALIEN, T>
|
|
{
|
|
public:
|
|
T operator()(const void * const pData) const
|
|
{
|
|
return ByteSwap(GetValueFromUnalignedPointer<T>(pData));
|
|
}
|
|
};
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <size_t SIZE, MessageValidator::Endian ENDIAN, typename T>
|
|
class MessageValidator::CopyBinaryIntegralToBinaryIntegralT<false, true, SIZE, ENDIAN, T>
|
|
{
|
|
public:
|
|
StatusCode operator()(const void * const pData, T &value) const
|
|
{
|
|
return CopySignedBinaryIntegralToSignedBinaryIntegralInternal<ENDIAN, T>(value, pData, SIZE);
|
|
}
|
|
};
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <size_t SIZE, MessageValidator::Endian ENDIAN, typename T>
|
|
class MessageValidator::CopyBinaryIntegralToBinaryIntegralT<false, false, SIZE, ENDIAN, T>
|
|
{
|
|
public:
|
|
StatusCode operator()(const void * const pData, T &value) const
|
|
{
|
|
return CopyUnsignedBinaryIntegralToUnsignedBinaryIntegralInternal<ENDIAN, T>(value, pData, SIZE);
|
|
}
|
|
};
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <bool IS_SIGNED, size_t SIZE, MessageValidator::Endian ENDIAN, typename T>
|
|
class MessageValidator::CopyBinaryIntegralToBinaryIntegralT<true, IS_SIGNED, SIZE, ENDIAN, T>
|
|
{
|
|
public:
|
|
StatusCode operator()(const void * const pData, T &value) const
|
|
{
|
|
ACTIV_BOOST_STATIC_ASSERT(SIZE == sizeof(T));
|
|
|
|
value = GetValueFromUnalignedPointerInEndianT<ENDIAN, T>()(pData);
|
|
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
};
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
class MessageValidator::CopyBinaryIntegralToBinaryIntegralRtlT<true, ENDIAN, T>
|
|
{
|
|
public:
|
|
StatusCode operator()(const void * const pData, const size_t size, T &value) const
|
|
{
|
|
// NB intentionally no LIKELYs here.
|
|
if (sizeof(T) == size)
|
|
{
|
|
// Fast path for "normal" case.
|
|
value = GetValueFromUnalignedPointerInEndianT<ENDIAN, T>()(pData);
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
return CopySignedBinaryIntegralToSignedBinaryIntegralInternal<ENDIAN, T>(value, pData, size);
|
|
}
|
|
};
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template <MessageValidator::Endian ENDIAN, typename T>
|
|
class MessageValidator::CopyBinaryIntegralToBinaryIntegralRtlT<false, ENDIAN, T>
|
|
{
|
|
public:
|
|
StatusCode operator()(const void * const pData, const size_t size, T &value) const
|
|
{
|
|
// NB intentionally no LIKELYs here.
|
|
if (sizeof(T) == size)
|
|
{
|
|
// Fast path for "normal" case.
|
|
value = GetValueFromUnalignedPointerInEndianT<ENDIAN, T>()(pData);
|
|
return STATUS_CODE_SUCCESS;
|
|
}
|
|
|
|
return CopyUnsignedBinaryIntegralToUnsignedBinaryIntegralInternal<ENDIAN, T>(value, pData, size);
|
|
}
|
|
};
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<>
|
|
class MessageValidator::CopyAsciiHexadecimalIntegralToUnsignedBinaryIntegralT<MessageValidator::ENDIAN_LITTLE>
|
|
{
|
|
public:
|
|
ACTIV_BASE_API uint64_t operator()(const void * const pData, size_t length) const;
|
|
};
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<>
|
|
class MessageValidator::CopyAsciiHexadecimalIntegralToUnsignedBinaryIntegralT<MessageValidator::ENDIAN_BIG>
|
|
{
|
|
public:
|
|
ACTIV_BASE_API uint64_t operator()(const void * const pData, size_t length) const;
|
|
};
|
|
|
|
} // namespace Activ
|
|
|
|
#endif // (!defined ACTIV_BASE_MESSAGE_VALIDATOR_H)
|