File indexing completed on 2024-04-28 05:18:35

0001 /*
0002     SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "mboxentry.h"
0008 
0009 #include "mboxentry_p.h"
0010 
0011 using namespace KMBox;
0012 
0013 MBoxEntry::MBoxEntry()
0014     : d(new MBoxEntryPrivate)
0015 {
0016 }
0017 
0018 MBoxEntry::MBoxEntry(quint64 offset)
0019     : d(new MBoxEntryPrivate)
0020 {
0021     d->mOffset = offset;
0022 }
0023 
0024 MBoxEntry::MBoxEntry(const MBoxEntry &other)
0025     : d(other.d)
0026 {
0027 }
0028 
0029 MBoxEntry::~MBoxEntry()
0030 {
0031 }
0032 
0033 MBoxEntry &MBoxEntry::operator=(const MBoxEntry &other)
0034 {
0035     if (this != &other) {
0036         d = other.d;
0037     }
0038 
0039     return *this;
0040 }
0041 
0042 bool MBoxEntry::operator==(const MBoxEntry &other) const
0043 {
0044     return d->mOffset == other.d->mOffset;
0045 }
0046 
0047 bool MBoxEntry::operator!=(const MBoxEntry &other) const
0048 {
0049     return !(other == *this);
0050 }
0051 
0052 bool MBoxEntry::isValid() const
0053 {
0054     return (d->mOffset != 0) && (d->mMessageSize != 0);
0055 }
0056 
0057 quint64 MBoxEntry::messageOffset() const
0058 {
0059     return d->mOffset;
0060 }
0061 
0062 quint64 MBoxEntry::messageSize() const
0063 {
0064     return d->mMessageSize;
0065 }
0066 
0067 quint64 MBoxEntry::separatorSize() const
0068 {
0069     return d->mSeparatorSize;
0070 }