Crypto++
8.6
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
7 #ifndef CRYPTOPP_FILES_H
8 #define CRYPTOPP_FILES_H
32 class OpenErr :
public Err {
public:
OpenErr(
const std::string &filename) :
Err(
"FileStore: error opening file for reading: " + filename) {}};
37 FileStore() : m_stream(NULLPTR), m_space(NULLPTR), m_len(0), m_waiting(0) {}
41 FileStore(std::istream &in) : m_stream(NULLPTR), m_space(NULLPTR), m_len(0), m_waiting(0)
46 FileStore(
const char *filename) : m_stream(NULLPTR), m_space(NULLPTR), m_len(0), m_waiting(0)
49 #if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) || _MSC_VER >= 1400
63 const std::istream*
GetStream()
const {
return m_stream;}
78 std::istream *m_stream;
112 #if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) || _MSC_VER >= 1400
140 class OpenErr :
public Err {
public:
OpenErr(
const std::string &filename) :
Err(
"FileSink: error opening file for writing: " + filename) {}};
158 #if defined(CRYPTOPP_UNIX_AVAILABLE) || _MSC_VER >= 1400
162 FileSink(
const wchar_t *filename,
bool binary=
true)
171 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
176 std::ostream *m_stream;
Exception thrown when file-based error is encountered.
const char * OutputBinaryMode()
bool
AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)
Create an object that implements NameValuePairs.
Create a working space in a BufferedTransformation.
const char * OutputStreamPointer()
std::ostream *
std::istream * GetStream()
Retrieves the internal stream.
FileSource(std::istream &in, bool pumpAll, BufferedTransformation *attachment=NULL)
Construct a FileSource.
Exception thrown when file-based open error is encountered.
FileSource(const char *filename, bool pumpAll, BufferedTransformation *attachment=NULL, bool binary=true)
Construct a FileSource.
const char * InputStreamPointer()
std::istream *
Implementation of Store interface.
const char * OutputFileName()
const char *
FileStore()
Construct a FileStore.
const char * InputBinaryMode()
bool
FileSink()
Construct a FileSink.
Implementation of BufferedTransformation's attachment interface.
const char * InputFileNameWide()
const wchar_t *
Acts as a Source for pre-existing, static data.
std::ostream * GetStream()
Retrieves the internal stream.
Classes for automatic resource management.
const std::string DEFAULT_CHANNEL
Default channel for BufferedTransformation.
FileStore(const wchar_t *filename)
Construct a FileStore.
Implementation of Store interface.
Implementation of BufferedTransformation's attachment interface.
FileStore(const char *filename)
Construct a FileStore.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
Standard names for retrieving values by name when working with NameValuePairs.
Base class for all exceptions thrown by the library.
Ensures an object is not copyable.
Exception thrown when file-based open error is encountered.
FileStore(std::istream &in)
Construct a FileStore.
FileSource(const wchar_t *filename, bool pumpAll, BufferedTransformation *attachment=NULL, bool binary=true)
Construct a FileSource.
FileSource(BufferedTransformation *attachment=NULL)
Construct a FileSource.
lword Skip(lword skipMax=ULONG_MAX)
Discard skipMax bytes from the output buffer.
const char * OutputFileNameWide()
const wchar_t *
size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const
Copy bytes from this object to another BufferedTransformation.
FileSink(std::ostream &out)
Construct a FileSink.
word64 lword
Large word type.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
Exception thrown when file-based write error is encountered.
std::istream * GetStream()
Retrieves the internal stream.
Crypto++ library namespace.
FileSink(const char *filename, bool binary=true)
Construct a FileSink.
Implementation of Store interface.
Exception thrown when file-based read error is encountered.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
bool IsolatedFlush(bool hardFlush, bool blocking)
Flushes data buffered by this object, without signal propagation.
const char * InputFileName()
const char *
Transform a Store into a Source.
const std::istream * GetStream() const
Retrieves the internal stream.
const lword LWORD_MAX
Large word type max value.
Interface for retrieving values given their names.
Abstract base classes that provide a uniform interface to this library.
Exception thrown when file-based error is encountered.
size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true)
Transfer bytes from this object to another BufferedTransformation.