260 ) { GetContentTypes().
SetAt(fileType, contentType); }
310 virtual void PrintOn(ostream & strm)
const;
344 virtual void PrintOn(ostream & strm)
const;
346 template <
typename T>
void Set(
374 #endif // PTLIB_PMIME_H
virtual void PrintOn(ostream &strm) const
Output the contents of the MIME dictionary to the stream.
static const PCaselessString & ContentTypeTag()
bool DecodeMultiPartList(PMultiPartList &parts, const PString &body, const PCaselessString &key) const
Decode parts from a multipart body using the field value.
This class contains the Multipurpose Internet Mail Extensions parameters and variables.
Definition: mime.h:48
This object describes the information associated with multi-part bodies.
Definition: mime.h:327
virtual void PrintOn(ostream &strm) const
virtual bool InternalAddMIME(const PString &fieldName, const PString &fieldValue)
PString m_textBody
Definition: mime.h:320
bool GetComplex(const PString &key, PStringToString &info) const
Definition: mime.h:164
bool GetComplex(const char *key, PStringToString &info) const
Get a complex MIME field.
Definition: mime.h:160
static bool ParseComplex(const PString &str, PStringToString &info)
Parse the string as a complex field, see GetComplex()
This is a dictionary collection class of PString objects, keyed by another string.
Definition: pstring.h:3151
PBoolean Write(PInternetProtocol &socket) const
Write MIME information to the socket.
PCaselessString m_contentType
Definition: mime.h:315
PCaselessString m_disposition
Definition: mime.h:318
bool Decode(const PString &body, const PStringToString &contentInfo)
This class is a variation of a string that ignores case.
Definition: pstring.h:2012
static const PCaselessString & TextHTML()
void Set(const T &data, const PString &contentType, const PString &disposition=PString::Empty())
Definition: mime.h:346
bool AddMIME(const PString &line)
Add a MIME field given a "name: value" format string.
static PString GetContentType(const PString &fileType)
Look up the file type to MIME content type association dictionary and return the MIME content type st...
virtual PINDEX Append(PObject *obj)
Append a new object to the collection.
void AddPart(const T &data, const PString &contentType, const PString &disposition=PString::Empty())
Definition: mime.h:355
This template class maps the PAbstractList to a specific object type.
Definition: lists.h:322
PBYTEArray m_binaryBody
Definition: mime.h:321
virtual void RemoveAll()
Remove all of the elements in the collection.
A TCP/IP socket for process/application layer high level protocols.
Definition: inetprot.h:61
Array of unsigned characters.
Definition: array.h:605
Specialised version of PStringToString to contain a dictionary of options/attributes.
Definition: pstring.h:3249
static const PCaselessString & ContentDispositionTag()
virtual void PrintOn(ostream &strm) const
static const PCaselessString & ApplicationJSON()
PCaselessString m_encoding
Definition: mime.h:317
PMultiPartInfo()
Definition: mime.h:298
PMIMEInfo m_mime
Definition: mime.h:319
static const PCaselessString & ContentTransferEncodingTag()
bool PBoolean
Definition: object.h:174
virtual ostream & PrintContents(ostream &strm) const
Output the contents without the trailing CRLF.
The character string class.
Definition: pstring.h:108
bool GetComplex(const PCaselessString &key, PStringToString &info) const
Definition: mime.h:168
PBoolean Read(PInternetProtocol &socket)
Read MIME information from the socket.
virtual PBoolean SetAt(const K &key, const PString &str)
Add a new object to the collection.
Definition: pstring.h:2978
PString m_boundary
Definition: mime.h:370
bool AddMIME(const PString &fieldName, const PString &fieldValue)
Definition: mime.h:118
const PString & GetBoundary() const
Get the boundary string used for encoding the multipart MIME body.
Definition: mime.h:367
static const PString & Empty()
Return an empty string.
bool GetComplex(const PCaselessString &(*key)(), PStringToString &info) const
Definition: mime.h:172
static void SetAssociation(const PStringToString &allTypes, PBoolean merge=true)
Set an association between a file type and a MIME content type.
void SetBoundary(const PString &boundary)
Set the boundary string used for encoding the multipart MIME body.
Definition: mime.h:364
PString GetString(const char *key, const char *dflt=NULL) const
Get an option value.
Definition: pstring.h:3286
static const PCaselessString & ContentIdTag()
static void SetAssociation(const PString &fileType, const PString &contentType)
Definition: mime.h:257
void AddMultiPartList(PMultiPartList &parts, const PCaselessString &(*key)()=ContentTypeTag)
bool DecodeMultiPartList(PMultiPartList &parts, const PString &body, const PCaselessString &(*key)()=ContentTypeTag) const
Decode parts from a multipart body using the field value.
Definition: mime.h:193
PMIMEInfo()
Definition: mime.h:51
void SetMIME()
Set the m_mime headers from fields.
static const PCaselessString & TextPlain()
This object describes the information associated with one part of a multi-part body.
Definition: mime.h:294
virtual void ReadFrom(istream &strm)
Input the contents of the MIME dictionary from the stream.
PString AsString() const
Return a string presentation of the MIME.
Ultimate parent class for all objects in the class library.
Definition: object.h:2204
PCaselessString m_charset
Definition: mime.h:316
static const PCaselessString & ContentDescriptionTag()