[][src]Struct qt_core::QTextDecoder

#[repr(C)]pub struct QTextDecoder { /* fields omitted */ }

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.

Methods

impl QTextDecoder[src]

pub unsafe fn has_failure(&self) -> bool[src]

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

pub unsafe fn needs_more_data(&self) -> bool[src]

This is supported 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.

pub unsafe fn new_1a(
    codec: impl CastInto<Ptr<QTextCodec>>
) -> CppBox<QTextDecoder>
[src]

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.

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

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.

pub unsafe fn to_unicode_2a(
    &self,
    chars: *const c_char,
    len: c_int
) -> CppBox<QString>
[src]

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.

pub unsafe fn to_unicode_1a(
    &self,
    ba: impl CastInto<Ref<QByteArray>>
) -> CppBox<QString>
[src]

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.

pub unsafe fn to_unicode_3a(
    &self,
    target: impl CastInto<Ptr<QString>>,
    chars: *const c_char,
    len: c_int
)
[src]

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

impl CppDeletable for QTextDecoder[src]

unsafe fn delete(&self)[src]

Destroys the decoder.

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

C++ documentation:

Destroys the decoder.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.