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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
<!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::MessageHeader</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 MessageHeader</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Net<br />
<b>Package:</b> Messages<br />
<b>Header:</b> Poco/Net/MessageHeader.h</p>
<h2>Description</h2>
<div class="description">
<p>A collection of name-value pairs that are used in various internet protocols like HTTP and SMTP. </p>
<p>The name is case-insensitive. </p>
<p>There can be more than one name-value pair with the same name. </p>
<p><a href="Poco.Net.MessageHeader.html" title="class Poco::Net::MessageHeader">MessageHeader</a> supports writing and reading the header data in <a href="http://www.ietf.org/rfc/rfc2822.txt" target="_blank">RFC 2822</a> format. </p>
</div>
<h2>Inheritance</h2>
<p><b>Direct Base Classes: </b><a href="Poco.Net.NameValueCollection.html" title="class Poco::Net::NameValueCollection">NameValueCollection</a></p>
<p><b>All Base Classes: </b><a href="Poco.Net.NameValueCollection.html" title="class Poco::Net::NameValueCollection">NameValueCollection</a></p>
<p><b>Known Derived Classes: </b><a href="Poco.Net.HTTPMessage.html" title="class Poco::Net::HTTPMessage">HTTPMessage</a>, <a href="Poco.Net.HTTPRequest.html" title="class Poco::Net::HTTPRequest">HTTPRequest</a>, <a href="Poco.Net.HTTPResponse.html" title="class Poco::Net::HTTPResponse">HTTPResponse</a>, <a href="Poco.Net.HTTPServerRequest.html" title="class Poco::Net::HTTPServerRequest">HTTPServerRequest</a>, <a href="Poco.Net.HTTPServerRequestImpl.html" title="class Poco::Net::HTTPServerRequestImpl">HTTPServerRequestImpl</a>, <a href="Poco.Net.HTTPServerResponse.html" title="class Poco::Net::HTTPServerResponse">HTTPServerResponse</a>, <a href="Poco.Net.HTTPServerResponseImpl.html" title="class Poco::Net::HTTPServerResponseImpl">HTTPServerResponseImpl</a>, <a href="Poco.Net.MailMessage.html" title="class Poco::Net::MailMessage">MailMessage</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Net.MessageHeader.html#13915" title="Poco::Net::MessageHeader::operator =()">operator =</a>, <a href="Poco.Net.MessageHeader.html#13933" title="Poco::Net::MessageHeader::quote()">quote</a>, <a href="Poco.Net.MessageHeader.html#13919" title="Poco::Net::MessageHeader::read()">read</a>, <a href="Poco.Net.MessageHeader.html#13921" title="Poco::Net::MessageHeader::splitElements()">splitElements</a>, <a href="Poco.Net.MessageHeader.html#13925" title="Poco::Net::MessageHeader::splitParameters()">splitParameters</a>, <a href="Poco.Net.MessageHeader.html#13917" title="Poco::Net::MessageHeader::write()">write</a></p>
<p><b>Inherited Functions: </b><a href="Poco.Net.NameValueCollection.html#14067" title="Poco::Net::NameValueCollection::add()">add</a>, <a href="Poco.Net.NameValueCollection.html#14079" title="Poco::Net::NameValueCollection::begin()">begin</a>, <a href="Poco.Net.NameValueCollection.html#14085" title="Poco::Net::NameValueCollection::clear()">clear</a>, <a href="Poco.Net.NameValueCollection.html#14081" title="Poco::Net::NameValueCollection::empty()">empty</a>, <a href="Poco.Net.NameValueCollection.html#14080" title="Poco::Net::NameValueCollection::end()">end</a>, <a href="Poco.Net.NameValueCollection.html#14083" title="Poco::Net::NameValueCollection::erase()">erase</a>, <a href="Poco.Net.NameValueCollection.html#14077" title="Poco::Net::NameValueCollection::find()">find</a>, <a href="Poco.Net.NameValueCollection.html#14070" title="Poco::Net::NameValueCollection::get()">get</a>, <a href="Poco.Net.NameValueCollection.html#14075" title="Poco::Net::NameValueCollection::has()">has</a>, <a href="Poco.Net.NameValueCollection.html#14062" title="Poco::Net::NameValueCollection::operator()">operator</a>, <a href="Poco.Net.NameValueCollection.html#14058" title="Poco::Net::NameValueCollection::operator =()">operator =</a>, <a href="Poco.Net.NameValueCollection.html#14064" title="Poco::Net::NameValueCollection::set()">set</a>, <a href="Poco.Net.NameValueCollection.html#14082" title="Poco::Net::NameValueCollection::size()">size</a>, <a href="Poco.Net.NameValueCollection.html#14060" title="Poco::Net::NameValueCollection::swap()">swap</a></p>
<h2>Constructors</h2>
<h3><a name="13911">MessageHeader</a></h3>
<p class="decl"><a href="Poco.Net.MessageHeader.html" title="class Poco::Net::MessageHeader">MessageHeader</a>();</p>
<div class="description">
<p>Creates the <a href="Poco.Net.MessageHeader.html" title="class Poco::Net::MessageHeader">MessageHeader</a>. </p>
</div>
<h3><a name="13912">MessageHeader</a></h3>
<p class="decl"><a href="Poco.Net.MessageHeader.html" title="class Poco::Net::MessageHeader">MessageHeader</a>(<br /> const <a href="Poco.Net.MessageHeader.html" title="class Poco::Net::MessageHeader">MessageHeader</a> & messageHeader<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.Net.MessageHeader.html" title="class Poco::Net::MessageHeader">MessageHeader</a> by copying another one. </p>
</div>
<h2>Destructor</h2>
<h3><a name="13914">~MessageHeader</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual ~<a href="Poco.Net.MessageHeader.html" title="class Poco::Net::MessageHeader">MessageHeader</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Net.MessageHeader.html" title="class Poco::Net::MessageHeader">MessageHeader</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="13915">operator =</a></h3>
<p class="decl"><a href="Poco.Net.MessageHeader.html" title="class Poco::Net::MessageHeader">MessageHeader</a> & operator = (<br /> const <a href="Poco.Net.MessageHeader.html" title="class Poco::Net::MessageHeader">MessageHeader</a> & messageHeader<br />);</p>
<div class="description">
<p>Assigns the content of another <a href="Poco.Net.MessageHeader.html" title="class Poco::Net::MessageHeader">MessageHeader</a>. </p>
</div>
<h3><a name="13933">quote</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void quote(<br /> const std::string & value,<br /> std::string & result,<br /> bool allowSpace = false<br />);</p>
<div class="description">
<p>Checks if the value must be quoted. If so, the value is appended to result, enclosed in double-quotes. Otherwise. the value is appended to result as-is. </p>
</div>
<h3><a name="13919">read</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void read(<br /> std::istream & istr<br />);</p>
<div class="description">
<p>Reads the message header from the given input stream. </p>
<p>See <a href="Poco.Net.MessageHeader.html#13917" title="Poco::Net::MessageHeader::write()">write</a>() for the expected format. Also supported is folding of field content, according to section 2.2.3 of <a href="http://www.ietf.org/rfc/rfc2822.txt" target="_blank">RFC 2822</a>. </p>
<p>Reading stops at the first empty line (a line only containing \r\n or \n), as well as at the end of the stream. </p>
<p>Some basic sanity checking of the input stream is performed. </p>
<p>Throws a <a href="Poco.Net.MessageException.html" title="class Poco::Net::MessageException">MessageException</a> if the input stream is malformed. </p>
</div>
<h3><a name="13921">splitElements</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void splitElements(<br /> const std::string & s,<br /> std::vector < std::string > & elements,<br /> bool ignoreEmpty = true<br />);</p>
<div class="description">
<p>Splits the given string into separate elements. Elements are expected to be separated by commas. </p>
<p>For example, the string </p>
<pre>text/plain; q=0.5, text/html, text/x-dvi; q=0.8
</pre>
<p>is split into the elements </p>
<pre>text/plain; q=0.5
text/html
text/x-dvi; q=0.8
</pre>
<p>Commas enclosed in double quotes do not split elements. </p>
<p>If ignoreEmpty is true, empty elements are not returned. </p>
</div>
<h3><a name="13925">splitParameters</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void splitParameters(<br /> const std::string & s,<br /> std::string & value,<br /> <a href="Poco.Net.NameValueCollection.html" title="class Poco::Net::NameValueCollection">NameValueCollection</a> & parameters<br />);</p>
<div class="description">
<p>Splits the given string into a value and a collection of parameters. Parameters are expected to be separated by semicolons. </p>
<p>Enclosing quotes of parameter values are removed. </p>
<p>For example, the string </p>
<pre>multipart/mixed; boundary="MIME_boundary_01234567"
</pre>
<p>is split into the value </p>
<pre>multipart/mixed
</pre>
<p>and the parameter </p>
<pre>boundary -> MIME_boundary_01234567
</pre>
</div>
<h3><a name="13929">splitParameters</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void splitParameters(<br /> const std::string::const_iterator & begin,<br /> const std::string::const_iterator & end,<br /> <a href="Poco.Net.NameValueCollection.html" title="class Poco::Net::NameValueCollection">NameValueCollection</a> & parameters<br />);</p>
<div class="description">
<p>Splits the given string into a collection of parameters. Parameters are expected to be separated by semicolons. </p>
<p>Enclosing quotes of parameter values are removed. </p>
</div>
<h3><a name="13917">write</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void write(<br /> std::ostream & ostr<br />) const;</p>
<div class="description">
<p>Writes the message header to the given output stream. </p>
<p>The format is one name-value pair per line, with name and value separated by a colon and lines delimited by a carriage return and a linefeed character. See <a href="http://www.ietf.org/rfc/rfc2822.txt" target="_blank">RFC 2822</a> for details. </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>
|