Пример #1
0
cstring __CS_PUBLIC__
cstring_cpy(cstring input)
{
	size_t len;
	char_t *output;
	assert(input);
	len = cstring_len(input);
	output = calloc(len + 1, sizeof(char_t));
	output[len] = CS_TERM;
	return (cstring) (output ? strncpy(output, input, len) : CS_NULL);
}
Пример #2
0
 int compare(size_type pos1, size_type len1, const CharT* s) const noexcept
 {
     return compare_primary(pos1, len1, s, 0, cstring_len(s));
 }
Пример #3
0
 //! Constructs this string view with the specified null terminated string.
 basic_cstring_view(const CharT* s) :
     str_ { s              },
     len_ { cstring_len(s) }
 {
 }
Пример #4
0
 int compare(const CharT* s) const noexcept
 {
     return compare_primary(0, size(), s, 0, cstring_len(s));
 }