Struct qt_core::QTextEncoder

source ·
#[repr(C)]
pub struct QTextEncoder { /* private fields */ }
Expand description

The QTextEncoder class provides a state-based encoder.

C++ class: QTextEncoder.

C++ documentation:

The QTextEncoder class provides a state-based encoder.

A text encoder converts text from Unicode into an encoded text format using a specific codec.

The encoder converts Unicode into another format, remembering any state that is required between calls.

Implementations§

source§

impl QTextEncoder

source

pub unsafe fn from_unicode_q_string( &self, str: impl CastInto<Ref<QString>> ) -> CppBox<QByteArray>

Converts the Unicode string str into an encoded QByteArray.

Calls C++ function: QByteArray QTextEncoder::fromUnicode(const QString& str).

C++ documentation:

Converts the Unicode string str into an encoded QByteArray.

source

pub unsafe fn from_unicode_q_char_int( &self, uc: impl CastInto<Ptr<QChar>>, len: c_int ) -> CppBox<QByteArray>

This is an overloaded function.

Calls C++ function: QByteArray QTextEncoder::fromUnicode(const QChar* uc, int len).

C++ documentation:

This is an overloaded function.

Converts len characters (not bytes) from uc, and returns the result in a QByteArray.

source

pub unsafe fn from_unicode_q_string_view( &self, str: impl CastInto<Ref<QStringView>> ) -> CppBox<QByteArray>

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: QByteArray QTextEncoder::fromUnicode(QStringView str).

C++ documentation:

This is an overloaded function.

Converts the Unicode string str into an encoded QByteArray.

This function was introduced in Qt 5.10.

source

pub unsafe fn has_failure(&self) -> bool

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

source

pub unsafe fn new_1a( codec: impl CastInto<Ptr<QTextCodec>> ) -> CppBox<QTextEncoder>

Constructs a text encoder for the given codec.

Calls C++ function: [constructor] void QTextEncoder::QTextEncoder(const QTextCodec* codec).

C++ documentation:

Constructs a text encoder for the given codec.

source

pub unsafe fn new_2a( codec: impl CastInto<Ptr<QTextCodec>>, flags: QFlags<ConversionFlag> ) -> CppBox<QTextEncoder>

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

Calls C++ function: [constructor] void QTextEncoder::QTextEncoder(const QTextCodec* codec, QFlags<QTextCodec::ConversionFlag> flags).

C++ documentation:

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

This function was introduced in Qt 4.7.

Trait Implementations§

source§

impl CppDeletable for QTextEncoder

source§

unsafe fn delete(&self)

Destroys the encoder.

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

C++ documentation:

Destroys the encoder.

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.