📄 filters_8h-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><title>Crypto++: filters.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.2 --><div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="classes.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul></div><div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul></div><h1>filters.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef CRYPTOPP_FILTERS_H</span><a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_FILTERS_H</span><a name="l00003"></a>00003 <span class="preprocessor"></span><a name="l00004"></a>00004 <span class="preprocessor">#include "<a class="code" href="simple_8h.html">simple.h</a>"</span><a name="l00005"></a>00005 <span class="preprocessor">#include "secblock.h"</span><a name="l00006"></a>00006 <span class="preprocessor">#include "misc.h"</span><a name="l00007"></a>00007 <span class="preprocessor">#include "smartptr.h"</span><a name="l00008"></a>00008 <span class="preprocessor">#include "queue.h"</span><a name="l00009"></a>00009 <span class="preprocessor">#include "algparam.h"</span><a name="l00010"></a>00010 <span class="preprocessor">#include <deque></span><a name="l00011"></a>00011 <a name="l00012"></a>00012 NAMESPACE_BEGIN(CryptoPP)<a name="l00013"></a>00013 <a name="l00014"></a>00014 <span class="comment">/// provides an implementation of BufferedTransformation's attachment interface</span><a name="l00015"></a><a class="code" href="class_filter.html">00015</a> <span class="comment"></span>class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_filter.html" title="provides an implementation of BufferedTransformation's attachment interface">Filter</a> : public <a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a>, public <a class="code" href="class_not_copyable.html">NotCopyable</a><a name="l00016"></a>00016 {<a name="l00017"></a>00017 <span class="keyword">public</span>:<a name="l00018"></a>00018 <a class="code" href="class_filter.html" title="provides an implementation of BufferedTransformation's attachment interface">Filter</a>(BufferedTransformation *attachment = NULL);<a name="l00019"></a>00019 <a name="l00020"></a><a class="code" href="class_filter.html#6e7251247b5c2cc3b0c15e861cc88e16">00020</a> <span class="keywordtype">bool</span> Attachable() {<span class="keywordflow">return</span> <span class="keyword">true</span>;}<a name="l00021"></a>00021 BufferedTransformation *AttachedTransformation();<a name="l00022"></a>00022 <span class="keyword">const</span> BufferedTransformation *AttachedTransformation() <span class="keyword">const</span>;<a name="l00023"></a>00023 <span class="keywordtype">void</span> Detach(BufferedTransformation *newAttachment = NULL);<a name="l00024"></a>00024 <a name="l00025"></a>00025 <span class="keywordtype">size_t</span> TransferTo2(BufferedTransformation &target, lword &transferBytes, <span class="keyword">const</span> std::string &channel=NULL_CHANNEL, <span class="keywordtype">bool</span> blocking=<span class="keyword">true</span>);<a name="l00026"></a>00026 <span class="keywordtype">size_t</span> CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, <span class="keyword">const</span> std::string &channel=NULL_CHANNEL, <span class="keywordtype">bool</span> blocking=<span class="keyword">true</span>) <span class="keyword">const</span>;<a name="l00027"></a>00027 <a name="l00028"></a>00028 <span class="keywordtype">void</span> Initialize(<span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html" title="interface for retrieving values given their names">NameValuePairs</a> &parameters=g_nullNameValuePairs, <span class="keywordtype">int</span> propagation=-1);<a name="l00029"></a>00029 <span class="keywordtype">bool</span> Flush(<span class="keywordtype">bool</span> hardFlush, <span class="keywordtype">int</span> propagation=-1, <span class="keywordtype">bool</span> blocking=<span class="keyword">true</span>);<a name="l00030"></a>00030 <span class="keywordtype">bool</span> MessageSeriesEnd(<span class="keywordtype">int</span> propagation=-1, <span class="keywordtype">bool</span> blocking=<span class="keyword">true</span>);<a name="l00031"></a>00031 <a name="l00032"></a>00032 <span class="keyword">protected</span>:<a name="l00033"></a>00033 <span class="keyword">virtual</span> BufferedTransformation * NewDefaultAttachment() <span class="keyword">const</span>;<a name="l00034"></a>00034 <span class="keywordtype">void</span> Insert(<a class="code" href="class_filter.html" title="provides an implementation of BufferedTransformation's attachment interface">Filter</a> *nextFilter); <span class="comment">// insert filter after this one</span><a name="l00035"></a>00035 <a name="l00036"></a><a class="code" href="class_filter.html#aaf7c866c3ef298ccdf22377e32c89ad">00036</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> ShouldPropagateMessageEnd()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">true</span>;}<a name="l00037"></a><a class="code" href="class_filter.html#514be4042d3262aef0e89772b0be192b">00037</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> ShouldPropagateMessageSeriesEnd()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">true</span>;}<a name="l00038"></a>00038 <a name="l00039"></a>00039 <span class="keywordtype">void</span> PropagateInitialize(<span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html" title="interface for retrieving values given their names">NameValuePairs</a> &parameters, <span class="keywordtype">int</span> propagation);<a name="l00040"></a>00040 <a name="l00041"></a>00041 <span class="keywordtype">size_t</span> Output(<span class="keywordtype">int</span> outputSite, <span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length, <span class="keywordtype">int</span> messageEnd, <span class="keywordtype">bool</span> blocking, <span class="keyword">const</span> std::string &channel=NULL_CHANNEL);<a name="l00042"></a>00042 <span class="keywordtype">size_t</span> OutputModifiable(<span class="keywordtype">int</span> outputSite, byte *inString, <span class="keywordtype">size_t</span> length, <span class="keywordtype">int</span> messageEnd, <span class="keywordtype">bool</span> blocking, <span class="keyword">const</span> std::string &channel=NULL_CHANNEL);<a name="l00043"></a>00043 <span class="keywordtype">bool</span> OutputMessageEnd(<span class="keywordtype">int</span> outputSite, <span class="keywordtype">int</span> propagation, <span class="keywordtype">bool</span> blocking, <span class="keyword">const</span> std::string &channel=NULL_CHANNEL);<a name="l00044"></a>00044 <span class="keywordtype">bool</span> OutputFlush(<span class="keywordtype">int</span> outputSite, <span class="keywordtype">bool</span> hardFlush, <span class="keywordtype">int</span> propagation, <span class="keywordtype">bool</span> blocking, <span class="keyword">const</span> std::string &channel=NULL_CHANNEL);<a name="l00045"></a>00045 <span class="keywordtype">bool</span> OutputMessageSeriesEnd(<span class="keywordtype">int</span> outputSite, <span class="keywordtype">int</span> propagation, <span class="keywordtype">bool</span> blocking, <span class="keyword">const</span> std::string &channel=NULL_CHANNEL);<a name="l00046"></a>00046 <a name="l00047"></a>00047 <span class="keyword">private</span>:<a name="l00048"></a>00048 <a class="code" href="classmember__ptr.html">member_ptr<BufferedTransformation></a> m_attachment;<a name="l00049"></a>00049 <a name="l00050"></a>00050 <span class="keyword">protected</span>:<a name="l00051"></a><a class="code" href="class_filter.html#5efea4f6caff4dca805c831a911eb1db">00051</a> <span class="keywordtype">size_t</span> m_inputPosition;<a name="l00052"></a><a class="code" href="class_filter.html#b57fb6112bb2cb7c018941bdcd7b4570">00052</a> <span class="keywordtype">int</span> m_continueAt;<a name="l00053"></a>00053 };<a name="l00054"></a>00054 <a name="l00055"></a><a class="code" href="struct_filter_put_space_helper.html">00055</a> <span class="keyword">struct </span>CRYPTOPP_DLL <a class="code" href="struct_filter_put_space_helper.html">FilterPutSpaceHelper</a><a name="l00056"></a>00056 {<a name="l00057"></a>00057 <span class="comment">// desiredSize is how much to ask target, bufferSize is how much to allocate in m_tempSpace</span><a name="l00058"></a><a class="code" href="struct_filter_put_space_helper.html#85fea9f0455741e4b340a3e035df9a39">00058</a> byte *HelpCreatePutSpace(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &target, <span class="keyword">const</span> std::string &channel, <span class="keywordtype">size_t</span> minSize, <span class="keywordtype">size_t</span> desiredSize, <span class="keywordtype">size_t</span> &bufferSize)<a name="l00059"></a>00059 {<a name="l00060"></a>00060 assert(desiredSize >= minSize && bufferSize >= minSize);<a name="l00061"></a>00061 <span class="keywordflow">if</span> (m_tempSpace.size() < minSize)<a name="l00062"></a>00062 {<a name="l00063"></a>00063 byte *result = target.<a class="code" href="class_buffered_transformation.html#877494d8de597af935cb770034f7f170">ChannelCreatePutSpace</a>(channel, desiredSize);<a name="l00064"></a>00064 <span class="keywordflow">if</span> (desiredSize >= minSize)<a name="l00065"></a>00065 {<a name="l00066"></a>00066 bufferSize = desiredSize;<a name="l00067"></a>00067 <span class="keywordflow">return</span> result;<a name="l00068"></a>00068 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -