[text.c.strings] (original) (raw)

28 Text processing library [text]

28.7 Null-terminated sequence utilities [text.c.strings]


28.7.1 Header synopsis [cctype.syn]

28.7.2 Header synopsis [cwctype.syn]

28.7.3 Header synopsis [cwchar.syn]

28.7.4 Header synopsis [cuchar.syn]

28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]


28.7.1 Header synopsis [cctype.syn]

namespace std { int isalnum(int c);int isalpha(int c);int isblank(int c);int iscntrl(int c);int isdigit(int c);int isgraph(int c);int islower(int c);int isprint(int c);int ispunct(int c);int isspace(int c);int isupper(int c);int isxdigit(int c);int tolower(int c);int toupper(int c);}

The contents and meaning of the header are the same as the C standard library header .

See also: ISO/IEC 9899:2024, 7.4

28.7.2 Header synopsis [cwctype.syn]

namespace std { using wint_t = see below;using wctrans_t = see below;using wctype_t = see below;int iswalnum(wint_t wc);int iswalpha(wint_t wc);int iswblank(wint_t wc);int iswcntrl(wint_t wc);int iswdigit(wint_t wc);int iswgraph(wint_t wc);int iswlower(wint_t wc);int iswprint(wint_t wc);int iswpunct(wint_t wc);int iswspace(wint_t wc);int iswupper(wint_t wc);int iswxdigit(wint_t wc);int iswctype(wint_t wc, wctype_t desc); wctype_t wctype(const char* property); wint_t towlower(wint_t wc); wint_t towupper(wint_t wc); wint_t towctrans(wint_t wc, wctrans_t desc); wctrans_t wctrans(const char* property);} #define WEOF see below

The contents and meaning of the header are the same as the C standard library header .

See also: ISO/IEC 9899:2024, 7.32

28.7.3 Header synopsis [cwchar.syn]

The contents and meaning of the header are the same as the C standard library header, except that it does not declare a type wchar_t.

[Note 1:

The functionswcschr, wcspbrk, wcsrchr, wcsstr, and wmemchrhave different signatures in this document, but they have the same behavior as in the C standard library ([library.c]).

— _end note_]

See also: ISO/IEC 9899:2024, 7.31

28.7.4 Header synopsis [cuchar.syn]

#define __STDC_VERSION_UCHAR_H__ 202311L namespace std { using mbstate_t = see below;using size_t = see [support.types.layout]; size_t mbrtoc8(char8_t* pc8, const char* s, size_t n, mbstate_t* ps); size_t c8rtomb(char* s, char8_t c8, mbstate_t* ps); size_t mbrtoc16(char16_t* pc16, const char* s, size_t n, mbstate_t* ps); size_t c16rtomb(char* s, char16_t c16, mbstate_t* ps); size_t mbrtoc32(char32_t* pc32, const char* s, size_t n, mbstate_t* ps); size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);}

The contents and meaning of the header are the same as the C standard library header , except that it does not declare typeschar8_t, char16_t, or char32_t.

See also: ISO/IEC 9899:2024, 7.30

28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]

[Note 1:

The headers ,, and declare the functions described in this subclause.

— _end note_]

int mbsinit(const mbstate_t* ps);int mblen(const char* s, size_t n); size_t mbstowcs(wchar_t* pwcs, const char* s, size_t n); size_t wcstombs(char* s, const wchar_t* pwcs, size_t n);

Effects: These functions have the semantics specified in the C standard library.

See also: ISO/IEC 9899:2024, 7.24.8.2, 7.24.9, 7.31.6.3.1

int mbtowc(wchar_t* pwc, const char* s, size_t n);int wctomb(char* s, wchar_t wchar);

Effects: These functions have the semantics specified in the C standard library.

Remarks: Calls to these functions may introduce a data race ([res.on.data.races]) with other calls to the same function.

See also: ISO/IEC 9899:2024, 7.24.8

size_t [mbrlen](#lib:mbrlen "28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]")(const char* s, size_t n, mbstate_t* ps); size_t [mbrtowc](#lib:mbrtowc "28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]")(wchar_t* pwc, const char* s, size_t n, mbstate_t* ps); size_t [wcrtomb](#lib:wcrtomb "28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]")(char* s, wchar_t wc, mbstate_t* ps); size_t [mbrtoc8](#lib:mbrtoc8 "28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]")(char8_t* pc8, const char* s, size_t n, mbstate_t* ps); size_t [c8rtomb](#lib:c8rtomb "28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]")(char* s, char8_t c8, mbstate_t* ps); size_t [mbrtoc16](#lib:mbrtoc16 "28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]")(char16_t* pc16, const char* s, size_t n, mbstate_t* ps); size_t [c16rtomb](#lib:c16rtomb "28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]")(char* s, char16_t c16, mbstate_t* ps); size_t [mbrtoc32](#lib:mbrtoc32 "28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]")(char32_t* pc32, const char* s, size_t n, mbstate_t* ps); size_t [c32rtomb](#lib:c32rtomb "28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]")(char* s, char32_t c32, mbstate_t* ps); size_t [mbsrtowcs](#lib:mbsrtowcs "28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]")(wchar_t* dst, const char** src, size_t len, mbstate_t* ps); size_t [wcsrtombs](#lib:wcsrtombs "28.7.5 Multibyte / wide string and character conversion functions [c.mb.wcs]")(char* dst, const wchar_t** src, size_t len, mbstate_t* ps);

Effects: These functions have the semantics specified in the C standard library.

Remarks: Calling these functions with an mbstate_t* argument that is a null pointer value may introduce a data race ([res.on.data.races]) with other calls to the same function with an mbstate_t* argument that is a null pointer value.

See also: ISO/IEC 9899:2024, 7.30.2, 7.31.6.4, 7.31.6.5