PLCnext API Documentation 25.0.2.69
Static Public Member Functions | List of all members
Arp::Base::Core::SafeString Class Reference

Static Public Member Functions

static size_t GetBufferSizeLimit (void)
 Returns the maximum buffer size supported by the SecureStr* functions More...
 
static size_t GetStringLengthLimit (void)
 Returns the limit of string length supported by SafeString operations More...
 
static bool IsNullOrEmpty (const char *str)
 Determines if str is a nullptr or the string is empty More...
 
static size_t GetLength (std::span< const char > str)
 Wrapper for the safe strnlen_s function. More...
 
static size_t GetLength (const char *str, size_t bufferSize)
 Wrapper for safe operation strnlen_s More...
 
static bool TryGetLength (std::span< const char > str, size_t &result)
 Wrapper for the safe strnlen_s function. More...
 
static bool TryGetLength (const char *str, size_t bufferSize, size_t &result)
 Wrapper for the safe strnlen_s function. More...
 
static void Copy (std::span< char > destStr, const char *srcStr)
 Wrapper for safe strcpy_s function. More...
 
static void Copy (std::span< char > destStr, const char *srcStr, size_t count)
 Wrapper for safe strcpy_s function. More...
 
static void Copy (char *destStr, size_t bufferSize, const char *srcStr)
 Wrapper for safe strcpy_s function More...
 
static void Copy (char *destStr, size_t bufferSize, const char *srcStr, size_t count)
 Wrapper for safe strcpy_s function More...
 

Member Function Documentation

◆ Copy() [1/4]

void Arp::Base::Core::SafeString::Copy ( char *  destStr,
size_t  destBufferSize,
const char *  srcStr 
)
static

Wrapper for safe strcpy_s function

Parameters
destStrThe pointer to the destination array
destBufferSizeThe size of the destination buffer
srcStrThe pointer to the source string
Exceptions
ExceptionIf any error occurs

◆ Copy() [2/4]

void Arp::Base::Core::SafeString::Copy ( char *  destStr,
size_t  destBufferSize,
const char *  srcStr,
size_t  count 
)
static

Wrapper for safe strcpy_s function

Parameters
destStrThe pointer to the destination array
destBufferSizeThe size of the destination buffer
srcStrThe pointer to the source string
countThe maximal number of characters to copy
Exceptions
ExceptionIf any error occurs

◆ Copy() [3/4]

void Arp::Base::Core::SafeString::Copy ( std::span< char >  dest,
const char *  src 
)
static

Wrapper for safe strcpy_s function.

Parameters
destThe span of the destination
srcThe pointer to the source string to copy.
Exceptions
ExceptionIf any error occurs

◆ Copy() [4/4]

void Arp::Base::Core::SafeString::Copy ( std::span< char >  dest,
const char *  src,
size_t  count 
)
static

Wrapper for safe strcpy_s function.

Parameters
destThe span of the destination
srcThe pointer to the source string
countThe number of characters to copy
Exceptions
ExceptionIf any error occurs

◆ GetBufferSizeLimit()

size_t Arp::Base::Core::SafeString::GetBufferSizeLimit ( void  )
static

Returns the maximum buffer size supported by the SecureStr* functions

Returns
maximum buffer size supported by the SecureStr* functions

◆ GetLength() [1/2]

size_t Arp::Base::Core::SafeString::GetLength ( const char *  str,
size_t  bufferSize 
)
static

Wrapper for safe operation strnlen_s

Parameters
strThe pointer to the string to determine the length from.
bufferSizeThe size of the string buffer.
Returns
The length of the string
Exceptions
ExceptionIf any error occurs

◆ GetLength() [2/2]

size_t Arp::Base::Core::SafeString::GetLength ( std::span< const char >  str)
static

Wrapper for the safe strnlen_s function.

Parameters
strspan of the string
Returns
length of the string
Exceptions
ExceptionIf any error occurs

◆ GetStringLengthLimit()

size_t Arp::Base::Core::SafeString::GetStringLengthLimit ( void  )
static

Returns the limit of string length supported by SafeString operations

Returns
The string length limit supported by the SafeString operations.

◆ IsNullOrEmpty()

bool Arp::Base::Core::SafeString::IsNullOrEmpty ( const char *  str)
static

Determines if str is a nullptr or the string is empty

Parameters
strThe pointer to the string
Returns
true if the string is empty or a nullptr, otherwise false.
Exceptions
ExceptionIf any error occurs.

◆ TryGetLength() [1/2]

bool Arp::Base::Core::SafeString::TryGetLength ( const char *  str,
size_t  bufferSize,
size_t &  length 
)
static

Wrapper for the safe strnlen_s function.

Parameters
strThe pointer to the string to determine the length from.
bufferSizeThe size of the string buffer.
Returns
true if the length of the string fits into the buffer, otherwise false.

◆ TryGetLength() [2/2]

bool Arp::Base::Core::SafeString::TryGetLength ( std::span< const char >  str,
size_t &  length 
)
static

Wrapper for the safe strnlen_s function.

Parameters
strspan of the string
lengthThe resulting length of the string
Returns
true if the length of the string fits into the span, otherwise false.

The documentation for this class was generated from the following files: