KIMAP::ImapSet Class
Represents a set of natural numbers (1->∞) in a as compact as possible form. More...
| Header: | #include <KIMAP/ImapSet> |
| CMake: | find_package(KPim6IMAP REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::IMAP) |
Public Types
Public Functions
| ImapSet() | |
| ImapSet(KIMAP::ImapSet::Id value) | |
| ImapSet(KIMAP::ImapSet::Id begin, KIMAP::ImapSet::Id end) | |
| ImapSet(const KIMAP::ImapSet &other) | |
| ~ImapSet() | |
| void | add(KIMAP::ImapSet::Id value) |
| void | add(const KIMAP::ImapInterval &interval) |
| void | add(const QList<KIMAP::ImapSet::Id> &values) |
| ImapInterval::List | intervals() const |
| bool | isEmpty() const |
| void | optimize() |
| QByteArray | toImapSequenceSet() const |
| KIMAP::ImapSet & | operator=(const KIMAP::ImapSet &other) |
| bool | operator==(const KIMAP::ImapSet &other) const |
Static Public Members
| KIMAP::ImapSet | fromImapSequenceSet(const QByteArray &sequence) |
Detailed Description
Used to address Akonadi items via the IMAP protocol or in the database.
This class is implicitly shared.
Member Type Documentation
[alias] ImapSet::Id
Describes the ids stored in the set.
Member Function Documentation
ImapSet::ImapSet()
Constructs an empty set.
[explicit] ImapSet::ImapSet(KIMAP::ImapSet::Id value)
Constructs a set containing a single value.
ImapSet::ImapSet(KIMAP::ImapSet::Id begin, KIMAP::ImapSet::Id end)
Constructs a set containing a single interval.
ImapSet::ImapSet(const KIMAP::ImapSet &other)
Copy constructor.
[noexcept] ImapSet::~ImapSet()
Destructor.
void ImapSet::add(KIMAP::ImapSet::Id value)
Adds a single positive integer numbers to the set.
The list is sorted and split into as large as possible intervals.
No interval merging is performed.
value A positive integer number
void ImapSet::add(const KIMAP::ImapInterval &interval)
Adds the given ImapInterval to this set.
No interval merging is performed.
interval the interval to add
void ImapSet::add(const QList<KIMAP::ImapSet::Id> &values)
Adds the given list of positive integer numbers to the set.
The list is sorted and split into as large as possible intervals.
No interval merging is performed.
values List of positive integer numbers in arbitrary order
[static] KIMAP::ImapSet ImapSet::fromImapSequenceSet(const QByteArray &sequence)
Return the set corresponding to the given IMAP-compatible QByteArray representation
ImapInterval::List ImapSet::intervals() const
Returns the intervals this set consists of.
bool ImapSet::isEmpty() const
Returns true if this set doesn't contains any values.
void ImapSet::optimize()
Optimizes the ImapSet by sorting and merging overlapping intervals.
Normally you shouldn't need to call this method. KIMAP will make sure to optimize the ImapSet before serializing it to string and sending it to the IMAP server.
QByteArray ImapSet::toImapSequenceSet() const
Returns a IMAP-compatible QByteArray representation of this set.
KIMAP::ImapSet &ImapSet::operator=(const KIMAP::ImapSet &other)
Assignment operator.
bool ImapSet::operator==(const KIMAP::ImapSet &other) const
Comparison operator.