Struct qt_core::QTextDecoder
source · #[repr(C)]pub struct QTextDecoder { /* private fields */ }
Expand description
The QTextDecoder class provides a state-based decoder.
C++ class: QTextDecoder
.
The QTextDecoder class provides a state-based decoder.
A text decoder converts text from an encoded text format into Unicode using a specific codec.
The decoder converts text in this format into Unicode, remembering any state that is required between calls.
Implementations§
source§impl QTextDecoder
impl QTextDecoder
sourcepub unsafe fn has_failure(&self) -> bool
pub unsafe fn has_failure(&self) -> bool
Calls C++ function: bool QTextDecoder::hasFailure() const
.
sourcepub unsafe fn needs_more_data(&self) -> bool
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn needs_more_data(&self) -> bool
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Calls C++ function: bool QTextDecoder::needsMoreData() const
.
sourcepub unsafe fn new_1a(
codec: impl CastInto<Ptr<QTextCodec>>
) -> CppBox<QTextDecoder>
pub unsafe fn new_1a( codec: impl CastInto<Ptr<QTextCodec>> ) -> CppBox<QTextDecoder>
Constructs a text decoder for the given codec.
Calls C++ function: [constructor] void QTextDecoder::QTextDecoder(const QTextCodec* codec)
.
Constructs a text decoder for the given codec.
sourcepub unsafe fn new_2a(
codec: impl CastInto<Ptr<QTextCodec>>,
flags: QFlags<ConversionFlag>
) -> CppBox<QTextDecoder>
pub unsafe fn new_2a( codec: impl CastInto<Ptr<QTextCodec>>, flags: QFlags<ConversionFlag> ) -> CppBox<QTextDecoder>
Constructs a text decoder for the given codec and conversion flags.
Calls C++ function: [constructor] void QTextDecoder::QTextDecoder(const QTextCodec* codec, QFlags<QTextCodec::ConversionFlag> flags)
.
Constructs a text decoder for the given codec and conversion flags.
This function was introduced in Qt 4.7.
sourcepub unsafe fn to_unicode_2a(
&self,
chars: *const c_char,
len: c_int
) -> CppBox<QString>
pub unsafe fn to_unicode_2a( &self, chars: *const c_char, len: c_int ) -> CppBox<QString>
Converts the first len bytes in chars to Unicode, returning the result.
Calls C++ function: QString QTextDecoder::toUnicode(const char* chars, int len)
.
Converts the first len bytes in chars to Unicode, returning the result.
If not all characters are used (e.g. if only part of a multi-byte encoding is at the end of the characters), the decoder remembers enough state to continue with the next call to this function.
sourcepub unsafe fn to_unicode_1a(
&self,
ba: impl CastInto<Ref<QByteArray>>
) -> CppBox<QString>
pub unsafe fn to_unicode_1a( &self, ba: impl CastInto<Ref<QByteArray>> ) -> CppBox<QString>
This is an overloaded function.
Calls C++ function: QString QTextDecoder::toUnicode(const QByteArray& ba)
.
This is an overloaded function.
Converts the bytes in the byte array specified by ba to Unicode and returns the result.
sourcepub unsafe fn to_unicode_3a(
&self,
target: impl CastInto<Ptr<QString>>,
chars: *const c_char,
len: c_int
)
pub unsafe fn to_unicode_3a( &self, target: impl CastInto<Ptr<QString>>, chars: *const c_char, len: c_int )
This is an overloaded function.
Calls C++ function: void QTextDecoder::toUnicode(QString* target, const char* chars, int len)
.
This is an overloaded function.
The converted string is returned in target.