aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/pop/MCPOPMessageInfo.cpp
blob: 418d159db5c55af004347b3b96d9f10c4fc81540 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "MCPOPMessageInfo.h"

using namespace mailcore;

void POPMessageInfo::init()
{
    mIndex = 0;
    mSize = 0;
    mUid = NULL;
}

POPMessageInfo::POPMessageInfo()
{
    init();
}

POPMessageInfo::POPMessageInfo(POPMessageInfo * other)
{
    init();
    mIndex = other->mIndex;
    mSize = other->mSize;
    MC_SAFE_REPLACE_COPY(String, mUid, other->mUid);
}

POPMessageInfo::~POPMessageInfo()
{
    MC_SAFE_RELEASE(mUid);
}

String * POPMessageInfo::description()
{
    return String::stringWithUTF8Format("<%s:%p %u %s %u>",
        MCUTF8(className()), this, mIndex, MCUTF8(mUid), mSize);
}

Object * POPMessageInfo::copy()
{
    return new POPMessageInfo(this);
}

void POPMessageInfo::setIndex(unsigned int index)
{
    mIndex = index;
}

unsigned int POPMessageInfo::index()
{
    return mIndex;
}

void POPMessageInfo::setSize(unsigned int size)
{
    mSize = size;
}

unsigned int POPMessageInfo::size()
{
    return mSize;
}

void POPMessageInfo::setUid(String * uid)
{
    MC_SAFE_REPLACE_COPY(String, mUid, uid);
}

String * POPMessageInfo::uid()
{
    return mUid;
}