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) || (CRYPTOPP_MSC_VERSION >= 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) || (CRYPTOPP_MSC_VERSION >= 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) || (CRYPTOPP_MSC_VERSION >= 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;
AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)
Create an object that implements NameValuePairs.
Standard names for retrieving values by name when working with NameValuePairs.
Base class for all exceptions thrown by the library.
Exception thrown when file-based error is encountered.
Exception thrown when file-based open error is encountered.
Exception thrown when file-based write error is encountered.
Implementation of Store interface.
std::ostream * GetStream()
Retrieves the internal stream.
FileSink()
Construct a FileSink.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
FileSink(const char *filename, bool binary=true)
Construct a FileSink.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
FileSink(std::ostream &out)
Construct a FileSink.
bool IsolatedFlush(bool hardFlush, bool blocking)
Flushes data buffered by this object, without signal propagation.
Implementation of Store interface.
FileSource(std::istream &in, bool pumpAll, BufferedTransformation *attachment=NULL)
Construct a FileSource.
FileSource(const char *filename, bool pumpAll, BufferedTransformation *attachment=NULL, bool binary=true)
Construct a FileSource.
std::istream * GetStream()
Retrieves the internal stream.
FileSource(const wchar_t *filename, bool pumpAll, BufferedTransformation *attachment=NULL, bool binary=true)
Construct a FileSource.
FileSource(BufferedTransformation *attachment=NULL)
Construct a FileSource.
Exception thrown when file-based error is encountered.
Exception thrown when file-based open error is encountered.
Exception thrown when file-based read error is encountered.
Implementation of Store interface.
size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true)
Transfer bytes from this object to another BufferedTransformation.
lword Skip(lword skipMax=ULONG_MAX)
Discard skipMax bytes from the output buffer.
FileStore(const char *filename)
Construct a FileStore.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
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.
FileStore(std::istream &in)
Construct a FileStore.
std::istream * GetStream()
Retrieves the internal stream.
const std::istream * GetStream() const
Retrieves the internal stream.
FileStore()
Construct a FileStore.
FileStore(const wchar_t *filename)
Construct a FileStore.
Interface for retrieving values given their names.
Ensures an object is not copyable.
Implementation of BufferedTransformation's attachment interface.
Transform a Store into a Source.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
Acts as a Source for pre-existing, static data.
Pointer that overloads operator ->
const lword LWORD_MAX
Large word type max value.
word64 lword
Large word type.
Abstract base classes that provide a uniform interface to this library.
const std::string DEFAULT_CHANNEL
Default channel for BufferedTransformation.
Implementation of BufferedTransformation's attachment interface.
Crypto++ library namespace.
const char * InputStreamPointer()
std::istream *
const char * InputFileName()
const char *
const char * OutputBinaryMode()
bool
const char * OutputStreamPointer()
std::ostream *
const char * InputBinaryMode()
bool
const char * OutputFileNameWide()
const wchar_t *
const char * OutputFileName()
const char *
const char * InputFileNameWide()
const wchar_t *
Classes for automatic resource management.
Create a working space in a BufferedTransformation.