/usr/include/mimetic/rfc822/mailbox.h is in libmimetic-dev 0.9.7-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | /***************************************************************************
copyright : (C) 2002-2008 by Stefano Barbato
email : stefano@codesink.org
$Id: mailbox.h,v 1.14 2008-10-07 11:06:27 tat Exp $
***************************************************************************/
#ifndef _MIMETIC_RFC822_MAILBOX_H_
#define _MIMETIC_RFC822_MAILBOX_H_
#include <string>
#include <mimetic/rfc822/fieldvalue.h>
namespace mimetic
{
/// Represents a \e mailbox email address as defined in the RFC822
/**
Use this class if you want to build or parse email addresses. Each email address
as defined by RFC822 have a mailbox std::string, a domain name, a sourceroute and
a label. Note that just mailbox and domain are mandatory.
Mailboxes can be represented in different ways, can contain rfc822 comments and
blank spaces, can be double-quoted and contain source route. Please read the
RFC822 for details.
Parsing:
\code
Mailbox mbx("Mario (Spider)Rossi <@free.it@move.it:mrossi@dom.it>");
cout << mbx.mailbox() << endl;
cout << mbx.domain() << endl;
cout << mbx.label() << endl;
cout << mbx.sourceroute() << endl;
cout << mbx.text() << endl;
\endcode
Building:
\code
Mailbox mbx;
mbx.mailbox("mrossi");
mbx.domain("dom.it");
mbx.label("Mario (Spider)Rossi");
mbx.sourceroute("@free.it@move.it");
\endcode
\sa <a href="../RFC/rfc822.txt">RFC822</a>
*/
struct Mailbox: public FieldValue
{
Mailbox();
Mailbox(const char*);
Mailbox(const std::string&);
void mailbox(const std::string&);
void domain(const std::string&);
void label(const std::string&);
void sourceroute(const std::string&);
std::string mailbox(int bCanonical = 1) const;
std::string domain(int bCanonical = 1) const;
std::string label(int bCanonical = 0) const;
std::string sourceroute(int bCanonical = 1) const;
bool operator==(const Mailbox&) const;
bool operator!=(const Mailbox&) const;
void set(const std::string&);
std::string str() const;
protected:
FieldValue* clone() const;
private:
std::string m_mailbox, m_domain, m_label, m_route;
};
}
#endif
|