📄 mime_8h-source.html
字号:
00108 <span class="comment">// PMIMEInfo</span>00109 00114 <span class="preprocessor">#ifdef DOC_PLUS_PLUS</span><a name="l00115"></a><a class="code" href="classPMIMEInfo.html">00115</a> <span class="preprocessor"></span><span class="keyword">class </span><a class="code" href="classPMIMEInfo.html">PMIMEInfo</a> : <span class="keyword">public</span> <a class="code" href="classPStringToString.html">PStringToString</a> {00116 <span class="preprocessor">#endif</span>00117 <span class="preprocessor"></span><a class="code" href="pstring_8h.html#a1">PDECLARE_STRING_DICTIONARY</a>(<a class="code" href="classPMIMEInfo.html">PMIMEInfo</a>, <a class="code" href="classPCaselessString.html">PCaselessString</a>);00118 <span class="keyword">public</span>:00119 <a class="code" href="classPMIMEInfo.html#a0">PMIMEInfo</a>(00120 istream &strm <span class="comment">// Stream to read the objects contents from.</span>00121 );00122 <a class="code" href="classPMIMEInfo.html#a0">PMIMEInfo</a>(00123 <a class="code" href="classPInternetProtocol.html">PInternetProtocol</a> & socket <span class="comment">// Application socket to read MIME info.</span>00124 );00125 <span class="comment">// Construct a MIME infromation dictionary from the specified source.</span>00126 00127 00128 <span class="comment">// Overrides from class PObject</span>00132 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPMIMEInfo.html#a2">PrintOn</a>(00133 ostream &strm <span class="comment">// Stream to print the object into.</span>00134 ) <span class="keyword">const</span>;00135 00139 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPMIMEInfo.html#a3">ReadFrom</a>(00140 istream &strm <span class="comment">// Stream to read the objects contents from.</span>00141 );00142 00143 00144 <span class="comment">// Overrides from class PStringToString</span><a name="l00151"></a><a class="code" href="classPMIMEInfo.html#a4">00151</a> <span class="comment"></span> BOOL <a class="code" href="classPMIMEInfo.html#a4">SetAt</a>(00152 <span class="keyword">const</span> <span class="keywordtype">char</span> * key,00153 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> value00154 ) { <span class="keywordflow">return</span> AbstractSetAt(<a class="code" href="classPCaselessString.html">PCaselessString</a>(key), <a class="code" href="object_8h.html#a18">PNEW</a> <a class="code" href="classPString.html">PString</a>(value)); }00155 <a name="l00162"></a><a class="code" href="classPMIMEInfo.html#a5">00162</a> BOOL <a class="code" href="classPMIMEInfo.html#a4">SetAt</a>(00163 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & key,00164 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> value00165 ) { <span class="keywordflow">return</span> AbstractSetAt(<a class="code" href="classPCaselessString.html">PCaselessString</a>(key), <a class="code" href="object_8h.html#a18">PNEW</a> <a class="code" href="classPString.html">PString</a>(value)); }00166 <a name="l00173"></a><a class="code" href="classPMIMEInfo.html#a6">00173</a> BOOL <a class="code" href="classPMIMEInfo.html#a4">SetAt</a>(00174 <span class="keyword">const</span> <a class="code" href="classPCaselessString.html">PCaselessString</a> & key,00175 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> value00176 ) { <span class="keywordflow">return</span> AbstractSetAt(<a class="code" href="classPCaselessString.html">PCaselessString</a>(key), <a class="code" href="object_8h.html#a18">PNEW</a> <a class="code" href="classPString.html">PString</a>(value)); }00177 <a name="l00184"></a><a class="code" href="classPMIMEInfo.html#a7">00184</a> BOOL <a class="code" href="classPMIMEInfo.html#a7">Contains</a>(00185 <span class="keyword">const</span> <span class="keywordtype">char</span> * key <span class="comment">// Key into MIME dictionary to get info.</span>00186 )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> GetAt(<a class="code" href="classPCaselessString.html">PCaselessString</a>(key)) != NULL; }00187 <a name="l00194"></a><a class="code" href="classPMIMEInfo.html#a8">00194</a> BOOL <a class="code" href="classPMIMEInfo.html#a7">Contains</a>(00195 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & key <span class="comment">// Key into MIME dictionary to get info.</span>00196 )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> GetAt(<a class="code" href="classPCaselessString.html">PCaselessString</a>(key)) != NULL; }00197 <a name="l00204"></a><a class="code" href="classPMIMEInfo.html#a9">00204</a> BOOL <a class="code" href="classPMIMEInfo.html#a7">Contains</a>(00205 <span class="keyword">const</span> <a class="code" href="classPCaselessString.html">PCaselessString</a> & key <span class="comment">// Key into MIME dictionary to get info.</span>00206 )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> GetAt(key) != NULL; }00207 00208 <span class="comment">// New functions for class.</span>00214 <span class="comment"></span> BOOL <a class="code" href="classPMIMEInfo.html#a10">Read</a>(00215 <a class="code" href="classPInternetProtocol.html">PInternetProtocol</a> & socket <span class="comment">// Application socket to read MIME info.</span>00216 );00217 00223 BOOL <a class="code" href="classPMIMEInfo.html#a11">Write</a>(00224 <a class="code" href="classPInternetProtocol.html">PInternetProtocol</a> & socket <span class="comment">// Application socket to write MIME info.</span>00225 ) <span class="keyword">const</span>;00226 00235 BOOL <a class="code" href="classPMIMEInfo.html#a12">AddMIME</a>(00236 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & line00237 );00238 00246 <a class="code" href="classPString.html">PString</a> <a class="code" href="classPMIMEInfo.html#a13">GetString</a>(00247 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & key, <span class="comment">// Key into MIME dictionary to get info.</span>00248 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & dflt <span class="comment">// Default value of field if not in MIME info.</span>00249 ) <span class="keyword">const</span>;00250 00258 <span class="keywordtype">long</span> <a class="code" href="classPMIMEInfo.html#a14">GetInteger</a>(00259 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & key, <span class="comment">// Key into MIME dictionary to get info.</span>00260 <span class="keywordtype">long</span> dflt = 0 <span class="comment">// Default value of field if not in MIME info.</span>00261 ) <span class="keyword">const</span>;00262 00265 <span class="keywordtype">void</span> <a class="code" href="classPMIMEInfo.html#a15">SetInteger</a>(00266 <span class="keyword">const</span> <a class="code" href="classPCaselessString.html">PCaselessString</a> & key, <span class="comment">// Key into MIME dictionary to get info.</span>00267 <span class="keywordtype">long</span> value <span class="comment">// New value of field.</span>00268 );00269 00270 00308 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classPMIMEInfo.html#d0">SetAssociation</a>(00309 <span class="keyword">const</span> <a class="code" href="classPStringToString.html">PStringToString</a> & allTypes, <span class="comment">// MIME content type associations.</span>00310 BOOL merge = TRUE <span class="comment">// Flag for merging associations.</span>00311 );<a name="l00312"></a><a class="code" href="classPMIMEInfo.html#d1">00312</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classPMIMEInfo.html#d0">SetAssociation</a>(00313 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & fileType, <span class="comment">// File type (extension) to match.</span>00314 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & contentType <span class="comment">// MIME content type string.</span>00315 ) { GetContentTypes().SetAt(fileType, contentType); }00316 00324 <span class="keyword">static</span> <a class="code" href="classPString.html">PString</a> <a class="code" href="classPMIMEInfo.html#d2">GetContentType</a>(00325 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & fileType <span class="comment">// File type (extension) to look up.</span>00326 );00327 00328 <span class="keyword">private</span>:00329 <span class="keyword">static</span> <a class="code" href="classPStringToString.html">PStringToString</a> & GetContentTypes();00330 };00331 00332 00333 00334 <span class="preprocessor">#endif</span>00335 <span class="preprocessor"></span>00336 00337 <span class="comment">// End Of File ///////////////////////////////////////////////////////////////</span></pre></div><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:11 2004 for PWLib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -