Namespaces
Variants
Views
Actions

std::mbrlen

From cppreference.com
< cpp | string | multibyte
Revision as of 17:18, 25 December 2011 by Cubbi (Talk | contribs)

Template:cpp/string/multibyte/sidebar

Defined in header <cwchar>
std::size_t mbrlen( const char* s, std::size_t n, std::mbstate_t* ps);

Determines the size, in bytes, of the remainder of the multibyte character whose first byte is pointed to by s, given the current conversion state ps.

This function is equivalent to the call Template:cpp for some hidden object internal of type Template:cpp, except that the expression ps is evaluated only once.

Contents

Parameters

s - pointer to an element of a multibyte character string
n - limit on the number of bytes in s that can be examined
ps - pointer to the variable holding the conversion state

Return value

Template:cpp if the next n or fewer bytes complete the null character.

The number of bytes (between Template:cpp and Template:cpp) that complete a valid multibyte character

Template:cpp if encoding error occurs

Template:cpp if the next n bytes are part of a possibly valid multibyte character, which is still incomplete after examining all n bytes

Example

Template:example cpp

See also

converts the next multibyte character to wide character, given state
(function) [edit]
returns the number of bytes in the next multibyte character
(function) [edit]
[virtual]
calculates the length of the externT string that would be consumed by conversion into given internT buffer
(virtual protected member function of std::codecvt) [edit]