kopete/protocols/messenger/libpapillon
Papillon::MimeHeader Class Reference
#include <Papillon/MimeHeader>
Detailed Description
Create/Manage a MIME header.This class build a key-value associate from a MIME header. Use MimeHeader::parseMimeHeader() static method to get a MimeHeader instance from raw data. You must set MIME-Version yourself. It doesn't support the full MIME header, only the things required for Windows Live Messenger.
This class is implicit shared.
Definition at line 37 of file mimeheader.h.
Public Member Functions | |
| MimeHeader () | |
| MimeHeader (const MimeHeader ©) | |
| ~MimeHeader () | |
| MimeHeader & | operator= (const MimeHeader &other) |
| bool | isValid () const |
| bool | hasKey (const QString &key) const |
| QVariant | value (const QString &key) const |
| void | setValue (const QString &key, const QVariant &value) |
| QString | mimeVersion () const |
| void | setMimeVersion (const QString &mimeVersion=QString("1.0")) |
| QString | contentType () const |
| void | setContentType (const QString &type) |
| QString | charset () const |
| void | setCharset (const QString &charset) |
| QString | toString () const |
Static Public Member Functions | |
| static MimeHeader | parseMimeHeader (const QString &data) |
Constructor & Destructor Documentation
| Papillon::MimeHeader::MimeHeader | ( | ) |
| Papillon::MimeHeader::MimeHeader | ( | const MimeHeader & | copy | ) |
Copy constructor It doesn't create a full copy, just make a refrence.
- Parameters:
-
copy other MimeHeader
Definition at line 44 of file mimeheader.cpp.
| Papillon::MimeHeader::~MimeHeader | ( | ) |
Member Function Documentation
| MimeHeader & Papillon::MimeHeader::operator= | ( | const MimeHeader & | other | ) |
Assignment operator.
Like the copy constructor, it just make a reference.
- Parameters:
-
other other MimeHeader
- Returns:
- this MimeHeader.
Definition at line 48 of file mimeheader.cpp.
| MimeHeader Papillon::MimeHeader::parseMimeHeader | ( | const QString & | data | ) | [static] |
Parse MIME header from raw data.
You can pass more than the MIME header, the parser will only parse the MIME header.
- Parameters:
-
data raw data to parse the MIME header from
- Returns:
- MimeHeader object.
Definition at line 54 of file mimeheader.cpp.
| bool Papillon::MimeHeader::isValid | ( | ) | const |
Does the MIME header is valid.
Just test if the MimeHeader is empty.
- Returns:
- true if the MIME header is valid.
Definition at line 94 of file mimeheader.cpp.
| bool Papillon::MimeHeader::hasKey | ( | const QString & | key | ) | const |
Check if the header has the given key.
- Parameters:
-
key Given key.
- Returns:
- true if the header have the given key.
Definition at line 99 of file mimeheader.cpp.
Get the first value for the given key.
- Returns:
- the Value as QVariant.
Definition at line 104 of file mimeheader.cpp.
Add or update a value for the given key.
- Parameters:
-
key key to update or add. value
Definition at line 109 of file mimeheader.cpp.
| QString Papillon::MimeHeader::mimeVersion | ( | ) | const |
Get the MIME version for this header.
- Returns:
- the MIME version as a string.
Definition at line 114 of file mimeheader.cpp.
Set the MIME version for this header.
By default it set to 1.0.
- Parameters:
-
mimeVersion MIME version as "1.0"
Definition at line 118 of file mimeheader.cpp.
| QString Papillon::MimeHeader::contentType | ( | ) | const |
Get the content type.
- Returns:
- the content type if the key is present.
Definition at line 123 of file mimeheader.cpp.
| void Papillon::MimeHeader::setContentType | ( | const QString & | type | ) |
Set the content type for the message.
- Parameters:
-
type Content type such as text/plain
Definition at line 127 of file mimeheader.cpp.
| QString Papillon::MimeHeader::charset | ( | ) | const |
| void Papillon::MimeHeader::setCharset | ( | const QString & | charset | ) |
Set the charset for the message.
- Parameters:
-
charset charset as a string.
Definition at line 136 of file mimeheader.cpp.
| QString Papillon::MimeHeader::toString | ( | ) | const |
Get a string represention of the MIME header.
- Returns:
- a complete string looking like "Key: Value\r\n"
Definition at line 141 of file mimeheader.cpp.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference