An opaque handle representing string encoding conversion state.
More...
|
size_t | iconv (const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) |
| This function converts text between encodings, reading from and writing to a buffer.
|
|
constexpr | Resource (T resource={}) |
| Constructs from the underlying resource.
|
|
constexpr | Resource (const ResourceHandle< Resource< T > > auto &resource) |
| Constructs from pointer like.
|
|
constexpr | Resource (std::nullptr_t) |
| Equivalent to default ctor.
|
|
constexpr | Resource (std::nullopt_t) |
| Equivalent to default ctor.
|
|
constexpr | Resource (SDL_iconv_data_t * resource={}) |
| Constructs from the underlying resource.
|
|
constexpr | Resource (const ResourceHandle< Resource< SDL_iconv_data_t * > > auto &resource) |
| Constructs from pointer like.
|
|
constexpr | Resource (std::nullptr_t) |
| Equivalent to default ctor.
|
|
constexpr | Resource (std::nullopt_t) |
| Equivalent to default ctor.
|
|
constexpr | operator bool () const |
| True if contains a valid resource.
|
|
constexpr | operator value_type () const |
| Converts back to underlying type.
|
|
constexpr bool | operator== (const Resource &other) const=default |
| Comparison.
|
|
constexpr bool | operator== (std::nullopt_t) const |
| Comparison.
|
|
constexpr bool | operator== (std::nullptr_t) const |
| Comparison.
|
|
constexpr SDL_iconv_data_t * | get () const |
| Return contained resource;.
|
|
constexpr const SDL_iconv_data_t * | operator-> () const |
| Access to fields.
|
|
constexpr SDL_iconv_data_t * | operator-> () |
| Access to fields.
|
|
|
static void | reset (SDL_iconv_data_t *resource) |
| This function frees a context used for character set conversion.
|
|
|
using | value_type = SDL_iconv_data_t * |
| The raw resource type.
|
|
- Since
- This datatype is available since SDL 3.2.0.
- Category:
- Resource
- See also
- IConv.open
-
IConv
◆ iconv()
size_t SDL::IConvRef::iconv |
( |
const char ** |
inbuf, |
|
|
size_t * |
inbytesleft, |
|
|
char ** |
outbuf, |
|
|
size_t * |
outbytesleft |
|
) |
| |
|
inline |
It returns the number of successful conversions on success. On error, SDL_ICONV_E2BIG is returned when the output buffer is too small, or SDL_ICONV_EILSEQ is returned when an invalid input sequence is encountered, or SDL_ICONV_EINVAL is returned when an incomplete input sequence is encountered.
On exit:
- inbuf will point to the beginning of the next multibyte sequence. On error, this is the location of the problematic input sequence. On success, this is the end of the input sequence.
- inbytesleft will be set to the number of bytes left to convert, which will be 0 on success.
- outbuf will point to the location where to store the next output byte.
- outbytesleft will be set to the number of bytes left in the output buffer.
- Parameters
-
inbuf | Address of variable that points to the first character of the input sequence. |
inbytesleft | The number of bytes in the input buffer. |
outbuf | Address of variable that points to the output buffer. |
outbytesleft | The number of bytes in the output buffer. |
- Returns
- the number of conversions on success, or a negative error code.
- Since
- This function is available since SDL 3.2.0.
- See also
- IConv.IConv
-
IConvRef.close
-
iconv_string
◆ reset()
static void SDL::IConvRef::reset |
( |
SDL_iconv_data_t * |
resource | ) |
|
|
inlinestatic |
The documentation for this struct was generated from the following file: