📄 files_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++: files.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>files.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef CRYPTOPP_FILES_H</span><a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_FILES_H</span><a name="l00003"></a>00003 <span class="preprocessor"></span><a name="l00004"></a>00004 <span class="preprocessor">#include "<a class="code" href="cryptlib_8h.html">cryptlib.h</a>"</span><a name="l00005"></a>00005 <span class="preprocessor">#include "filters.h"</span><a name="l00006"></a>00006 <span class="preprocessor">#include "argnames.h"</span><a name="l00007"></a>00007 <a name="l00008"></a>00008 <span class="preprocessor">#include <iostream></span><a name="l00009"></a>00009 <span class="preprocessor">#include <fstream></span><a name="l00010"></a>00010 <a name="l00011"></a>00011 NAMESPACE_BEGIN(CryptoPP)<a name="l00012"></a>00012 <a name="l00013"></a>00013 <span class="comment">//! file-based implementation of Store interface</span><a name="l00014"></a><a class="code" href="class_file_store.html">00014</a> <span class="comment"></span>class CRYPTOPP_DLL <a class="code" href="class_file_store.html" title="file-based implementation of Store interface">FileStore</a> : public <a class="code" href="class_store.html" title="A BufferedTransformation that only contains pre-existing data as "output".">Store</a>, private <a class="code" href="struct_filter_put_space_helper.html">FilterPutSpaceHelper</a>, public <a class="code" href="class_not_copyable.html">NotCopyable</a><a name="l00015"></a>00015 {<a name="l00016"></a>00016 <span class="keyword">public</span>:<a name="l00017"></a><a class="code" href="class_file_store_1_1_err.html">00017</a> <span class="keyword">class </span><a class="code" href="class_file_store_1_1_err.html">Err</a> : <span class="keyword">public</span> <a class="code" href="class_exception.html" title="base class for all exceptions thrown by Crypto++">Exception</a><a name="l00018"></a>00018 {<a name="l00019"></a>00019 <span class="keyword">public</span>:<a name="l00020"></a><a class="code" href="class_file_store_1_1_err.html#ad7a4b5c0e782ec455dcb813fbd2c3b5">00020</a> <a class="code" href="class_file_store_1_1_err.html">Err</a>(<span class="keyword">const</span> std::string &s) : <a class="code" href="class_exception.html" title="base class for all exceptions thrown by Crypto++">Exception</a>(IO_ERROR, s) {}<a name="l00021"></a>00021 };<a name="l00022"></a><a class="code" href="class_file_store_1_1_open_err.html#8996140e49885d4a5a517b373c32b462">00022</a> <span class="keyword">class </span><a class="code" href="class_file_store_1_1_open_err.html">OpenErr</a> : <span class="keyword">public</span> <a class="code" href="class_file_store_1_1_err.html">Err</a> {<span class="keyword">public</span>: <a class="code" href="class_file_store_1_1_open_err.html">OpenErr</a>(<span class="keyword">const</span> std::string &filename) : <a class="code" href="class_file_store_1_1_err.html">Err</a>(<span class="stringliteral">"FileStore: error opening file for reading: "</span> + filename) {}};<a name="l00023"></a><a class="code" href="class_file_store_1_1_read_err.html#157aa2e66b8bc0b778f23572a82df3fe">00023</a> <span class="keyword">class </span><a class="code" href="class_file_store_1_1_read_err.html">ReadErr</a> : <span class="keyword">public</span> <a class="code" href="class_file_store_1_1_err.html">Err</a> {<span class="keyword">public</span>: <a class="code" href="class_file_store_1_1_read_err.html">ReadErr</a>() : <a class="code" href="class_file_store_1_1_err.html">Err</a>(<span class="stringliteral">"FileStore: error reading file"</span>) {}};<a name="l00024"></a>00024 <a name="l00025"></a><a class="code" href="class_file_store.html#adb823030f45a6a9690185f0279b6908">00025</a> <a class="code" href="class_file_store.html" title="file-based implementation of Store interface">FileStore</a>() : m_stream(NULL) {}<a name="l00026"></a><a class="code" href="class_file_store.html#4a3ea09952e93c4db7fedf277c6d217e">00026</a> <a class="code" href="class_file_store.html" title="file-based implementation of Store interface">FileStore</a>(std::istream &in)<a name="l00027"></a>00027 {StoreInitialize(MakeParameters(<a class="code" href="namespace_name.html#86928da4acaa3a6bfe38b16bfda4bc68" title="std::istream *">Name::InputStreamPointer</a>(), &in));}<a name="l00028"></a><a class="code" href="class_file_store.html#27d2d16927f16301fb178b676794a1fc">00028</a> <a class="code" href="class_file_store.html" title="file-based implementation of Store interface">FileStore</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename)<a name="l00029"></a>00029 {StoreInitialize(MakeParameters(<a class="code" href="namespace_name.html#d66764c80784dda0472b4862eed4cf94" title="const char *">Name::InputFileName</a>(), filename));}<a name="l00030"></a>00030 <a name="l00031"></a><a class="code" href="class_file_store.html#52271ff9a07861683eb41b9df0be7081">00031</a> std::istream* GetStream() {<span class="keywordflow">return</span> m_stream;}<a name="l00032"></a>00032 <a name="l00033"></a>00033 lword MaxRetrievable() <span class="keyword">const</span>;<a name="l00034"></a>00034 <span class="keywordtype">size_t</span> TransferTo2(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &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="l00035"></a>00035 <span class="keywordtype">size_t</span> CopyRangeTo2(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &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="l00036"></a>00036 lword Skip(lword skipMax=ULONG_MAX);<a name="l00037"></a>00037 <a name="l00038"></a>00038 <span class="keyword">private</span>:<a name="l00039"></a>00039 <span class="keywordtype">void</span> StoreInitialize(<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);<a name="l00040"></a>00040 <a name="l00041"></a>00041 <a class="code" href="classmember__ptr.html">member_ptr<std::ifstream></a> m_file;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -