#include "blocxx/BLOCXX_config.h"#include "blocxx/SafeCString.hpp"#include <cstring>#include <new>Go to the source code of this file.
Namespaces | |
| namespace | BLOCXX_NAMESPACE |
| namespace | BLOCXX_NAMESPACE::SafeCString |
| namespace | BLOCXX_NAMESPACE::SafeCString::Impl |
Functions | |
| char const * | strend (char const *s, std::size_t n) |
| char * | strend (char *s, std::size_t n) |
| char * | strend_checked (char *s, std::size_t n) |
| char * | safe_strcpy (char *dst, char const *src, std::size_t n) |
| char * | BLOCXX_NAMESPACE::SafeCString::str_dup (char const *s) |
| Like std::strdup, except that new is used to allocate memory. | |
| char * | BLOCXX_NAMESPACE::SafeCString::str_dup_nothrow (char const *s) |
| Like std::strdup, except that no-throw new is used to allocate memory and NULL is returned on allocation failure. | |
| char * | BLOCXX_NAMESPACE::SafeCString::strcpy_trunc (char *dst, std::size_t dstsize, char const *src) |
| PROMISE: copies the first n = min(strlen(src), dstsize - 1) characters of C-string src to dst, null-terminating the result. | |
| char * | BLOCXX_NAMESPACE::SafeCString::strcpy_trunc (char *dst, std::size_t dstsize, char const *src, std::size_t srclen) |
| PROMISE: copies the first n = min(strlen(src), srclen, dstsize - 1) characters of C-string src to dst, null-terminating the result. | |
| char * | BLOCXX_NAMESPACE::SafeCString::strcpy_check (char *dst, std::size_t dstsize, char const *src) |
| PROMISE: copies the first n = min(strlen(src), dstsize - 1) chars of the C-string src to dst and appends a terminating ''. | |
| char * | BLOCXX_NAMESPACE::SafeCString::strcpy_check (char *dst, std::size_t dstsize, char const *src, std::size_t srclen) |
| PROMISE: copies the first min(n, dstsize - 1) chars of the C-string src to dst, where n = min(strlen(src), srclen), and appends a terminating ''. | |
| char * | BLOCXX_NAMESPACE::SafeCString::strcat_trunc (char *dst, std::size_t dstsize, char const *src) |
| PROMISE: If dst[0. | |
| char * | BLOCXX_NAMESPACE::SafeCString::strcat_trunc (char *dst, std::size_t dstsize, char const *src, std::size_t srclen) |
| PROMISE: If dst[0. | |
| char * | BLOCXX_NAMESPACE::SafeCString::strcat_check (char *dst, std::size_t dstsize, char const *src) |
| PROMISE: If dst[0. | |
| char * | BLOCXX_NAMESPACE::SafeCString::strcat_check (char *dst, std::size_t dstsize, char const *src, std::size_t srclen) |
| PROMISE: If dst[0. | |
| std::size_t | BLOCXX_NAMESPACE::SafeCString::Impl::nchars_check (int retval, std::size_t dstsize) |
| char* @190::safe_strcpy | ( | char * | dst, | |
| char const * | src, | |||
| std::size_t | n | |||
| ) | [inline, static] |
Definition at line 78 of file SafeCString.cpp.
References strend().
Referenced by BLOCXX_NAMESPACE::SafeCString::strcpy_check(), and BLOCXX_NAMESPACE::SafeCString::strcpy_trunc().
| char* @190::strend | ( | char * | s, | |
| std::size_t | n | |||
| ) | [inline, static] |
| char const* @190::strend | ( | char const * | s, | |
| std::size_t | n | |||
| ) | [inline, static] |
Definition at line 48 of file SafeCString.cpp.
Referenced by safe_strcpy(), strend(), and strend_checked().
| char* @190::strend_checked | ( | char * | s, | |
| std::size_t | n | |||
| ) | [static] |
Definition at line 58 of file SafeCString.cpp.
References BLOCXX_THROW_ERR, BLOCXX_NAMESPACE::SafeCString::DEST_UNTERMINATED, and strend().
Referenced by BLOCXX_NAMESPACE::SafeCString::strcat_check(), and BLOCXX_NAMESPACE::SafeCString::strcat_trunc().
1.5.6