KMime::Headers::Base Class

class KMime::Headers::Base

Baseclass of all header-classes. More...

Header: #include <KMime/Headers>
CMake: find_package(KPim6 REQUIRED COMPONENTS Mime)
target_link_libraries(mytarget PRIVATE KPim6::Mime)
Inherited By:

KMime::Headers::Generics::Structured and KMime::Headers::Generics::Unstructured

Public Functions

Base()
(since 26.04 (previously with an additional bool argument to include the header type).) virtual QByteArray as7BitString() const = 0
virtual QString asUnicodeString() const = 0
virtual void from7BitString(QByteArrayView s) = 0
virtual void fromUnicodeString(const QString &s) = 0
bool is(QByteArrayView t) const
virtual bool isEmpty() const = 0
QByteArray rfc2047Charset() const
void setRFC2047Charset(const QByteArray &cs)
virtual const char *type() const

Detailed Description

It represents a header-field as described in RFC-822.

Member Function Documentation

Base::Base()

Creates an empty header.

[pure virtual, since 26.04 (previously with an additional bool argument to include the header type).] QByteArray Base::as7BitString() const

Returns the encoded header content.

This does not include the header type or separating colon.

This function was introduced in 26.04 (previously with an additional bool argument to include the header type)..

[pure virtual] QString Base::asUnicodeString() const

Returns the decoded content of the header without the header-type.

Note: The return value of this method should only be used when showing an address to the user. It is not guaranteed that fromUnicodeString( asUnicodeString(), ... ) will return the original string.

[pure virtual] void Base::from7BitString(QByteArrayView s)

Parses the given string.

Take care of RFC2047-encoded strings.

s The encoded header data.

[pure virtual] void Base::fromUnicodeString(const QString &s)

Parses the given Unicode representation of the header content.

s The header data as Unicode string.

bool Base::is(QByteArrayView t) const

Checks if this header is of type t.

[pure virtual] bool Base::isEmpty() const

Checks if this header contains any data.

QByteArray Base::rfc2047Charset() const

Returns the charset that is used for RFC2047-encoding.

void Base::setRFC2047Charset(const QByteArray &cs)

Sets the charset for RFC2047-encoding.

cs The new charset used for RFC2047 encoding.

[virtual] const char *Base::type() const

Returns the type of this header (e.g. "From").