KIMAP::ImapInterval Class

Represents a single interval in an ImapSet. More...

Header: #include <KIMAP/ImapSet>
CMake: find_package(KPim6IMAP REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::IMAP)

Public Types

Public Functions

ImapInterval()
ImapInterval(KIMAP::ImapInterval::Id begin, KIMAP::ImapInterval::Id end = 0)
ImapInterval(const KIMAP::ImapInterval &other)
~ImapInterval()
KIMAP::ImapInterval::Id begin() const
KIMAP::ImapInterval::Id end() const
bool hasDefinedBegin() const
bool hasDefinedEnd() const
void setBegin(KIMAP::ImapInterval::Id value)
void setEnd(KIMAP::ImapInterval::Id value)
KIMAP::ImapInterval::Id size() const
QByteArray toImapSequence() const
KIMAP::ImapInterval &operator=(const KIMAP::ImapInterval &other)
bool operator==(const KIMAP::ImapInterval &other) const

Static Public Members

KIMAP::ImapInterval fromImapSequence(const QByteArray &sequence)

Detailed Description

This class is implicitly shared.

Member Type Documentation

[alias] ImapInterval::Id

Describes the ids stored in the interval.

[alias] ImapInterval::List

A list of ImapInterval objects.

Member Function Documentation

ImapInterval::ImapInterval()

Constructs an interval that covers all positive numbers.

[explicit] ImapInterval::ImapInterval(KIMAP::ImapInterval::Id begin, KIMAP::ImapInterval::Id end = 0)

Create a new interval.

begin The begin of the interval.

end Keep default (0) to just set the interval begin

ImapInterval::ImapInterval(const KIMAP::ImapInterval &other)

Copy constructor.

[noexcept] ImapInterval::~ImapInterval()

Destructor.

KIMAP::ImapInterval::Id ImapInterval::begin() const

Returns the begin of this interval.

The value is the smallest value part of the interval.

Only valid if begin is defined.

See also setBegin().

KIMAP::ImapInterval::Id ImapInterval::end() const

Returns the end of this interval.

This value is the largest value part of the interval.

Only valid if hasDefinedEnd() returned true.

See also setEnd().

[static] KIMAP::ImapInterval ImapInterval::fromImapSequence(const QByteArray &sequence)

Return the interval corresponding to the given IMAP-compatible QByteArray representation

bool ImapInterval::hasDefinedBegin() const

Returns true if this interval has a defined begin.

bool ImapInterval::hasDefinedEnd() const

Returns true if this intercal has been defined.

void ImapInterval::setBegin(KIMAP::ImapInterval::Id value)

Sets the begin of the interval.

See also begin().

void ImapInterval::setEnd(KIMAP::ImapInterval::Id value)

Sets the end of this interval.

See also end().

KIMAP::ImapInterval::Id ImapInterval::size() const

Returns the size of this interval.

Size is only defined for finite intervals.

QByteArray ImapInterval::toImapSequence() const

Converts this set into an IMAP compatible sequence.

KIMAP::ImapInterval &ImapInterval::operator=(const KIMAP::ImapInterval &other)

Assignment operator.

bool ImapInterval::operator==(const KIMAP::ImapInterval &other) const

Comparison operator.