KMbox

mboxentry.cpp
1 /*
2  SPDX-FileCopyrightText: 2010 Tobias Koenig <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "mboxentry.h"
8 
9 #include "mboxentry_p.h"
10 
11 using namespace KMBox;
12 
14  : d(new MBoxEntryPrivate)
15 {
16 }
17 
18 MBoxEntry::MBoxEntry(quint64 offset)
19  : d(new MBoxEntryPrivate)
20 {
21  d->mOffset = offset;
22 }
23 
25  : d(other.d)
26 {
27 }
28 
30 {
31 }
32 
34 {
35  if (this != &other) {
36  d = other.d;
37  }
38 
39  return *this;
40 }
41 
42 bool MBoxEntry::operator==(const MBoxEntry &other) const
43 {
44  return d->mOffset == other.d->mOffset;
45 }
46 
47 bool MBoxEntry::operator!=(const MBoxEntry &other) const
48 {
49  return !(other == *this);
50 }
51 
52 bool MBoxEntry::isValid() const
53 {
54  return (d->mOffset != 0) && (d->mMessageSize != 0);
55 }
56 
57 quint64 MBoxEntry::messageOffset() const
58 {
59  return d->mOffset;
60 }
61 
62 quint64 MBoxEntry::messageSize() const
63 {
64  return d->mMessageSize;
65 }
66 
67 quint64 MBoxEntry::separatorSize() const
68 {
69  return d->mSeparatorSize;
70 }
quint64 messageOffset() const
Returns the offset of the message that is referenced by this mbox entry object.
Definition: mboxentry.cpp:57
bool operator==(const MBoxEntry &other) const
Returns whether this mbox entry object is equal to an other.
Definition: mboxentry.cpp:42
quint64 messageSize() const
Returns the size of the message that is referenced by this mbox entry object.
Definition: mboxentry.cpp:62
A class that encapsulates an entry of a MBox.
Definition: mboxentry.h:24
quint64 separatorSize() const
Returns the separator size of the message that is referenced by this mbox entry object.
Definition: mboxentry.cpp:67
MBoxEntry & operator=(const MBoxEntry &other)
Replaces this mbox entry object with an other object.
Definition: mboxentry.cpp:33
bool operator!=(const MBoxEntry &other) const
Returns whether this mbox entry object is not equal to an other.
Definition: mboxentry.cpp:47
Definition: mbox.h:15
MBoxEntry()
Creates an invalid mbox entry object.
Definition: mboxentry.cpp:13
bool isValid() const
Returns whether this is a valid mbox entry object.
Definition: mboxentry.cpp:52
~MBoxEntry()
Destroys the mbox entry object.
Definition: mboxentry.cpp:29
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jul 13 2020 23:09:07 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.