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 the underlying resource.
|
|
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 the underlying resource.
|
|
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 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 SDL_iconv_data_t * | release (SDL_iconv_data_t * newResource={}) |
| Return contained resource and empties or replace value.
|
|
constexpr const SDL_iconv_data_t * | operator-> () const |
| Access to fields.
|
|
constexpr SDL_iconv_data_t * | operator-> () |
| Access to fields.
|
|
|
int | close () |
| This function frees a context used for character set conversion.
|
|
int | reset (SDL_iconv_data_t *newResource={}) |
| This function frees a context used for character set conversion.
|
|
- Since
- This datatype is available since SDL 3.2.0.
- Category:
- Resource
- See also
- IConvRef.IConvRef
-
IConv
◆ close()
int SDL::IConvRef::close |
( |
| ) |
|
|
inlineprotected |
◆ 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()
int SDL::IConvRef::reset |
( |
SDL_iconv_data_t * |
newResource = {} | ) |
|
|
inlineprotected |
The documentation for this struct was generated from the following file: