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.

C++ documentation:

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

source

pub unsafe fn has_failure(&self) -> bool

Calls C++ function: bool QTextDecoder::hasFailure() const.

source

pub 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.

Calls C++ function: bool QTextDecoder::needsMoreData() const.

source

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).

C++ documentation:

Constructs a text decoder for the given codec.

source

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).

C++ documentation:

Constructs a text decoder for the given codec and conversion flags.

This function was introduced in Qt 4.7.

source

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).

C++ documentation:

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.

source

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).

C++ documentation:

This is an overloaded function.

Converts the bytes in the byte array specified by ba to Unicode and returns the result.

source

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).

C++ documentation:

This is an overloaded function.

The converted string is returned in target.

Trait Implementations§

source§

impl CppDeletable for QTextDecoder

source§

unsafe fn delete(&self)

Destroys the decoder.

Calls C++ function: [destructor] void QTextDecoder::~QTextDecoder().

C++ documentation:

Destroys the decoder.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.