summaryrefslogtreecommitdiff
path: root/src/mailbox.cc
blob: 53c8606da7076dfc47ea9c4717d7db65f844b7d8 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/**  --------------------------------------------------------------------
 *  @file mailbox.cc
 *  @brief  Implementation of the Mailbox class.
 *  @author Andreas Aardal Hanssen
 *  @date 2002-2005 
 *  -----------------------------------------------------------------  **/
#include <string>

#include "mailbox.h"
#include "message.h"

using namespace ::std;
using namespace Binc;

//------------------------------------------------------------------------
Mailbox::BaseIterator::BaseIterator(int sqn)
{
  sqnr = sqn;
}

//------------------------------------------------------------------------
Mailbox::BaseIterator::~BaseIterator(void)
{
}

//------------------------------------------------------------------------
Mailbox::Mailbox(void) : readOnly(false)
{
}

//------------------------------------------------------------------------
Mailbox::~Mailbox(void)
{
}

//------------------------------------------------------------------------
bool Mailbox::isReadOnly(void) const
{
  return readOnly;
}

//------------------------------------------------------------------------
void Mailbox::setReadOnly(bool readOnly)
{
  this->readOnly = readOnly;
}

//------------------------------------------------------------------------
Mailbox::iterator::iterator(BaseIterator &i)
  : realIterator(i)
{
}

//------------------------------------------------------------------------
Message &Mailbox::iterator::operator *(void)
{
  return *realIterator;
}

//------------------------------------------------------------------------
void Mailbox::iterator::operator ++(void)
{
  ++realIterator;
}

//------------------------------------------------------------------------
bool Mailbox::iterator::operator ==(const iterator &i) const
{
  return realIterator == i.realIterator;
}

//------------------------------------------------------------------------
bool Mailbox::iterator::operator !=(const iterator &i) const
{
  return realIterator != i.realIterator;
}

//------------------------------------------------------------------------
void Mailbox::iterator::erase(void)
{
  realIterator.erase();
}

//------------------------------------------------------------------------
unsigned int Mailbox::iterator::getSqnr(void) const
{
  return realIterator.sqnr;
}

//------------------------------------------------------------------------
void Mailbox::setName(const string &name)
{
  this->name = name;
}

//------------------------------------------------------------------------
const string Mailbox::getName(void) const
{
  return name;
}

//------------------------------------------------------------------------
const string &Mailbox::getLastError(void) const
{
  return lastError;
}

//------------------------------------------------------------------------
void Mailbox::setLastError(const string &error) const
{
  lastError = error;
}