nlib
Cstring.h File Reference

Wraps functions like strlen and strcpy so they can be safely used. More...

#include <stdarg.h>
#include <string.h>
#include "nn/nlib/Config.h"

Go to the source code of this file.

Namespaces

 nn::nlib
 Implements stream-related classes usually commonly used, various containers, and other gadget classes. nlib_ns is an alias.
 

Functions

size_t nn::nlib::StrLen (const char *str) noexcept
 Wraps the nlib_strlen function.
 
size_t nn::nlib::StrLen (const nlib_utf16_t *str) noexcept
 Wraps the nlib_utf16len function.
 
size_t nn::nlib::StrLen (const nlib_utf32_t *str) noexcept
 Wraps the nlib_utf32len function.
 
size_t nn::nlib::StrLen (const wchar_t *str) noexcept
 Wraps the nlib_wcslen function.
 
errno_t nn::nlib::CodePointCount (const char *str, size_t *count) noexcept
 Wraps the nlib_strcplen function.
 
errno_t nn::nlib::CodePointCount (const nlib_utf16_t *str, size_t *count) noexcept
 Wraps the nlib_utf16cplen function.
 
errno_t nn::nlib::CodePointCount (const nlib_utf32_t *str, size_t *count) noexcept
 Wraps the nlib_utf32cplen function.
 
errno_t nn::nlib::CodePointCount (const wchar_t *str, size_t *count) noexcept
 Wraps the nlib_wcscplen function.
 
int nn::nlib::StrCmp (const char *s1, const char *s2) noexcept
 Wraps the strcmp function.
 
int nn::nlib::StrCmp (const wchar_t *s1, const wchar_t *s2) noexcept
 Wraps the wcscmp function.
 
int nn::nlib::StrCmp (const nlib_utf16_t *s1, const nlib_utf16_t *s2) noexcept
 Compares UTF-16 strings in the same way as the strcmp function.
 
int nn::nlib::StrCmp (const nlib_utf32_t *s1, const nlib_utf32_t *s2) noexcept
 Compares UTF-32 strings in the same way as the strcmp function.
 
int nn::nlib::StrNcmp (const char *s1, const char *s2, size_t n) noexcept
 Wraps the strncmp function.
 
int nn::nlib::StrNcmp (const wchar_t *s1, const wchar_t *s2, size_t n) noexcept
 Wraps the wcsncmp function.
 
int nn::nlib::StrNcmp (const nlib_utf16_t *s1, const nlib_utf16_t *s2, size_t n) noexcept
 Compares UTF-16 strings in the same way as the strncmp function.
 
int nn::nlib::StrNcmp (const nlib_utf32_t *s1, const nlib_utf32_t *s2, size_t n) noexcept
 Compares UTF-32 strings in the same way as the strncmp function.
 
errno_t nn::nlib::StrCpy (char *dest, size_t dest_size, const char *src) noexcept
 Wraps the nlib_strcpy function.
 
errno_t nn::nlib::StrCpy (nlib_utf16_t *dest, size_t dest_size, const nlib_utf16_t *src) noexcept
 Wraps the nlib_utf16cpy function.
 
errno_t nn::nlib::StrCpy (nlib_utf32_t *dest, size_t dest_size, const nlib_utf32_t *src) noexcept
 Wraps the nlib_utf32cpy function.
 
errno_t nn::nlib::StrCpy (wchar_t *dest, size_t dest_size, const wchar_t *src) noexcept
 Wraps the nlib_wcscpy function.
 
template<class T , size_t N>
errno_t nn::nlib::StrCpy (T(&dest)[N], const T *src) noexcept
 Makes a call to StrCpy(&dest[0], N, src). More...
 
errno_t nn::nlib::StrNcpy (char *dest, size_t dest_size, const char *src, size_t n) noexcept
 Wraps the nlib_strncpy function.
 
errno_t nn::nlib::StrNcpy (nlib_utf16_t *dest, size_t dest_size, const nlib_utf16_t *src, size_t n) noexcept
 Wraps the nlib_utf16ncpy function.
 
errno_t nn::nlib::StrNcpy (nlib_utf32_t *dest, size_t dest_size, const nlib_utf32_t *src, size_t n) noexcept
 Wraps the nlib_utf32ncpy function.
 
errno_t nn::nlib::StrNcpy (wchar_t *dest, size_t dest_size, const wchar_t *src, size_t n) noexcept
 Wraps the nlib_wcsncpy function.
 
template<class T , size_t N>
errno_t nn::nlib::StrNcpy (T(&dest)[N], const T *src, size_t n) noexcept
 Makes an internal call to StrNcpy(&dest[0], N, src, n). More...
 
template<class T , size_t N>
errno_t nn::nlib::StrCat (T(&dest)[N], const T *src) noexcept
 Makes a call to StrCat(&dest[0], N, src). More...
 
template<class T , size_t N>
errno_t nn::nlib::StrNcat (T(&dest)[N], const T *src, size_t n) noexcept
 Makes an internal call to StrNcat(&dest[0], N, src, n). More...
 
int nn::nlib::VsnPrintfFallback (char *buf, size_t size, const char *fmt, va_list args) noexcept
 The fallback for VsnPrintf. Also implemented in a wide-character version. More...
 
int nn::nlib::VsnPrintf (char *buf, size_t size, const char *fmt, va_list args) noexcept
 Executes vsnprintf. More...
 
template<size_t N>
int nn::nlib::VsnPrintf (char(&buf)[N], const char *fmt, va_list args) noexcept
 Internally runs VsnPrintf(buf, N, fmt, args). More...
 
int nn::nlib::SnPrintf (char *buf, size_t size, const char *fmt,...) noexcept
 Makes a call to the VsnPrintf function, but otherwise operates the same way as snprintf. More...
 
template<size_t N>
int nn::nlib::SnPrintf (char(&buf)[N], const char *fmt,...) noexcept
 Internally runs the VsnPrintf function. More...
 
int nn::nlib::VsnPrintf (wchar_t *buf, size_t size, const wchar_t *fmt, va_list args) noexcept
 Executes vsnprintf. More...
 
template<size_t N>
int nn::nlib::VsnPrintf (wchar_t(&buf)[N], const wchar_t *fmt, va_list args) noexcept
 Internally runs VsnPrintf(buf, N, fmt, args). More...
 
int nn::nlib::SnPrintf (wchar_t *buf, size_t size, const wchar_t *fmt,...) noexcept
 Makes a call to the VsnPrintf function, but otherwise operates the same way as snwprintf. More...
 
template<size_t N>
int nn::nlib::SnPrintf (wchar_t(&buf)[N], const wchar_t *fmt,...) noexcept
 Internally runs the VsnPrintf function. More...
 

Detailed Description

Wraps functions like strlen and strcpy so they can be safely used.

Definition in file Cstring.h.