<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Class Poco::Net::MediaType</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="language" content="en"/> <meta name="date" content="2009-11-24"/> <meta name="generator" content="PocoDoc"/> <link rel="stylesheet" href="css/styles.css" type="text/css"/> </head> <body bgcolor="#ffffff" leftmargin="0" topmargin="0"> <div class="header"> <h1 class="namespace"><a href="Poco.Net.html" class="namespace">Poco::Net</a></h1> <h1 class="symbol">class MediaType</h1> </div> <div class="body"> <p> <b>Library:</b> Net<br /> <b>Package:</b> Messages<br /> <b>Header:</b> Poco/Net/MediaType.h</p> <h2>Description</h2> <div class="description"> <p>This class represents a MIME media type, consisting of a top-level type, a subtype and an optional set of parameters. </p> <p>The implementation conforms with <a href="http://www.ietf.org/rfc/rfc2045.txt" target="_blank">RFC 2045</a> and <a href="http://www.ietf.org/rfc/rfc2046.txt" target="_blank">RFC 2046</a>. </p> </div> <h2>Member Summary</h2> <p><b>Member Functions: </b><a href="Poco.Net.MediaType.html#13886" title="Poco::Net::MediaType::getParameter()">getParameter</a>, <a href="Poco.Net.MediaType.html#13882" title="Poco::Net::MediaType::getSubType()">getSubType</a>, <a href="Poco.Net.MediaType.html#13879" title="Poco::Net::MediaType::getType()">getType</a>, <a href="Poco.Net.MediaType.html#13888" title="Poco::Net::MediaType::hasParameter()">hasParameter</a>, <a href="Poco.Net.MediaType.html#13894" title="Poco::Net::MediaType::matches()">matches</a>, <a href="Poco.Net.MediaType.html#13871" title="Poco::Net::MediaType::operator =()">operator =</a>, <a href="Poco.Net.MediaType.html#13892" title="Poco::Net::MediaType::parameters()">parameters</a>, <a href="Poco.Net.MediaType.html#13901" title="Poco::Net::MediaType::parse()">parse</a>, <a href="Poco.Net.MediaType.html#13890" title="Poco::Net::MediaType::removeParameter()">removeParameter</a>, <a href="Poco.Net.MediaType.html#13883" title="Poco::Net::MediaType::setParameter()">setParameter</a>, <a href="Poco.Net.MediaType.html#13880" title="Poco::Net::MediaType::setSubType()">setSubType</a>, <a href="Poco.Net.MediaType.html#13877" title="Poco::Net::MediaType::setType()">setType</a>, <a href="Poco.Net.MediaType.html#13875" title="Poco::Net::MediaType::swap()">swap</a>, <a href="Poco.Net.MediaType.html#13893" title="Poco::Net::MediaType::toString()">toString</a></p> <h2>Constructors</h2> <h3><a name="13863">MediaType</a></h3> <p class="decl"><a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a>(<br /> const std::string & mediaType<br />);</p> <div class="description"> <p>Creates the <a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a> from the given string, which must have the format <type>/<subtype>{;<parameter>=<value>}. </p> </div> <h3><a name="13868">MediaType</a></h3> <p class="decl"><a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a>(<br /> const <a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a> & mediaType<br />);</p> <div class="description"> <p>Creates a <a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a> from another one. </p> </div> <h3><a name="13865">MediaType</a></h3> <p class="decl"><a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a>(<br /> const std::string & type,<br /> const std::string & subType<br />);</p> <div class="description"> <p>Creates the <a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a>, using the given type and subtype. </p> </div> <h2>Destructor</h2> <h3><a name="13870">~MediaType</a></h3> <p class="decl">~<a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a>();</p> <div class="description"> <p>Destroys the <a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a>. </p> </div> <h2>Member Functions</h2> <h3><a name="13886">getParameter</a></h3> <p class="decl">const std::string & getParameter(<br /> const std::string & name<br />) const;</p> <div class="description"> <p>Returns the parameter with the given name. </p> <p>Throws a <a href="Poco.NotFoundException.html" title="class Poco::NotFoundException">NotFoundException</a> if the parameter does not exist. </p> </div> <h3><a name="13882">getSubType</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">const std::string & getSubType() const;</p> <div class="description"> <p>Returns the sub type. </p> </div> <h3><a name="13879">getType</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">const std::string & getType() const;</p> <div class="description"> <p>Returns the top-level type. </p> </div> <h3><a name="13888">hasParameter</a></h3> <p class="decl">bool hasParameter(<br /> const std::string & name<br />) const;</p> <div class="description"> <p>Returns true if and only if a parameter with the given name exists. </p> </div> <h3><a name="13894">matches</a></h3> <p class="decl">bool matches(<br /> const <a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a> & mediaType<br />) const;</p> <div class="description"> <p>Returns true if and only if the type and subtype match the type and subtype of the given media type. Matching is case insensitive. </p> </div> <h3><a name="13896">matches</a></h3> <p class="decl">bool matches(<br /> const std::string & type,<br /> const std::string & subType<br />) const;</p> <div class="description"> <p>Returns true if and only if the type and subtype match the given type and subtype. Matching is case insensitive. </p> </div> <h3><a name="13899">matches</a></h3> <p class="decl">bool matches(<br /> const std::string & type<br />) const;</p> <div class="description"> <p>Returns true if and only if the type matches the given type. Matching is case insensitive. </p> </div> <h3><a name="13871">operator =</a></h3> <p class="decl"><a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a> & operator = (<br /> const <a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a> & mediaType<br />);</p> <div class="description"> <p>Assigns another media type. </p> </div> <h3><a name="13873">operator =</a></h3> <p class="decl"><a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a> & operator = (<br /> const std::string & mediaType<br />);</p> <div class="description"> <p>Assigns another media type. </p> </div> <h3><a name="13892">parameters</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">const <a href="Poco.Net.NameValueCollection.html" title="class Poco::Net::NameValueCollection">NameValueCollection</a> & parameters() const;</p> <div class="description"> <p>Returns the parameters. </p> </div> <h3><a name="13890">removeParameter</a></h3> <p class="decl">void removeParameter(<br /> const std::string & name<br />);</p> <div class="description"> <p>Removes the parameter with the given name. </p> </div> <h3><a name="13883">setParameter</a></h3> <p class="decl">void setParameter(<br /> const std::string & name,<br /> const std::string & value<br />);</p> <div class="description"> <p>Sets the parameter with the given name. </p> </div> <h3><a name="13880">setSubType</a></h3> <p class="decl">void setSubType(<br /> const std::string & subType<br />);</p> <div class="description"> <p>Sets the sub type. </p> </div> <h3><a name="13877">setType</a></h3> <p class="decl">void setType(<br /> const std::string & type<br />);</p> <div class="description"> <p>Sets the top-level type. </p> </div> <h3><a name="13875">swap</a></h3> <p class="decl">void swap(<br /> <a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a> & mediaType<br />);</p> <div class="description"> <p>Swaps the <a href="Poco.Net.MediaType.html" title="class Poco::Net::MediaType">MediaType</a> with another one. </p> </div> <h3><a name="13893">toString</a></h3> <p class="decl">std::string toString() const;</p> <div class="description"> <p>Returns the string representation of the media type which is <type>/<subtype>{;<parameter>=<value>} </p> </div> <h3><a name="13901">parse</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">void parse(<br /> const std::string & mediaType<br />);</p> <div class="description"> <p></p> </div> <p class="footer">POCO C++ Libraries 1.3.6-all<br /> Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p> </div> </body> </html>