aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/nntp/MCNNTPGroupInfo.cpp
blob: 8ebe08bc79f37071191bac30204ce5bcecd788ff (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
//
//  MCNNTPGroupInfo.cpp
//  mailcore2
//
//  Created by Robert Widmann on 3/6/14.
//  Copyright (c) 2014 MailCore. All rights reserved.
//

#include "MCNNTPGroupInfo.h"

using namespace mailcore;

void NNTPGroupInfo::init()
{
    mMessageCount = 0;
    mName = NULL;
}

NNTPGroupInfo::NNTPGroupInfo()
{
    MC_SAFE_RELEASE(mName);
    init();
}


NNTPGroupInfo::NNTPGroupInfo(NNTPGroupInfo * other)
{
    init();
    setMessageCount(other->messageCount());
    setName(other->name());
}

NNTPGroupInfo::~NNTPGroupInfo()
{
}

String * NNTPGroupInfo::description()
{
    return String::stringWithUTF8Format("<%s:%p> Group name: %s; Message count: %u",
                                        MCUTF8(className()), this, MCUTF8(mName), mMessageCount);
}

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

void NNTPGroupInfo::setName(String * name) 
{
    MC_SAFE_REPLACE_COPY(String, mName, name);
}

String * NNTPGroupInfo::name()
{
    return mName;
}

void NNTPGroupInfo::setMessageCount(uint32_t messageCount)
{
    mMessageCount = messageCount;
}

uint32_t NNTPGroupInfo::messageCount()
{
    return mMessageCount;
}