1
/***************************************************************************
2
copyright : (C) 2002-2005 by Stefano Barbato
3
email : stefano@codesink.org
5
$Id: group.h,v 1.11 2005/02/23 10:26:15 tat Exp $
6
***************************************************************************/
8
/***************************************************************************
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
15
***************************************************************************/
16
#ifndef _MIMETIC_RFC822_GROUP_H_
17
#define _MIMETIC_RFC822_GROUP_H_
20
#include <mimetic/rfc822/mailbox.h>
26
/// Represent the \e group type in the RFC822
28
Groups class is a container class that stores Rfc822::Mailbox objects.
29
Use this class when you need to create or parse rfc822 \e email \e groups
33
Rfc822::Group grp("drivers: first@do.com, second@dom.com, last@dom.com;");
34
Rfc822::Group::const_iterator bit(grp.begin()), eit(grp.end());
35
cout << "Group " << grp.name() << endl;
36
for(; bit != eit; ++bit)
37
cout << " " << *bit << endl;
43
grp.push_back("first@dom.com");
44
grp.push_back(Rfc822::Mailbox("second@dom.com"));
45
grp.push_back(string("last@dom.com"));
48
\sa <a href="../RFC/rfc822.txt">RFC822</a>
50
struct Group: public FieldValue, public std::vector<Mailbox>
54
Group(const std::string&);
55
void name(const std::string&);
56
std::string name(int bCanonical = 0) const;
57
void set(const std::string&);
58
std::string str() const;
60
FieldValue* clone() const;
62
std::string m_text, m_name;