chsvlib
chsv helper source code

◆ tcsnLen_s()

std::size_t Chusov::String::tcsnLen_s ( const CHAR_TYPE *  pszStr,
std::size_t  cchStr 
)
noexcept

Resolves to strnLen_s, to wcsnLen_s or to ucpsnLen_s depending on the template parameter.

Template Parameters
CHAR_TYPEis a type of a string character.
Parameters
[in]pszStris a pointer to a string of the returned length. The parameter may be NULL, the function returns 0 in this case.
[in]cchStris a size, in characters, of the buffer where the string is located. It is treated as a maximum length of the string. Thus, the returned value is less or equal to cchStr. The parameter is ignored if pszStr is NULL.
Returns
If the pszStr pointer is NULL, the function returns 0. Otherwise the function returns a length, in characters, of the string pointed to by pszStr. If the cchStr characters constitute a zero-terminated string the function behaves identically to tcsLen, returning a number of characters before the null terminator. Otherwise the function returns cchStr.