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;}
65 lword MaxRetrievable()
const;
66 size_t TransferTo2(
BufferedTransformation &target, lword &transferBytes,
const std::string &channel=DEFAULT_CHANNEL,
bool blocking=
true);
67 size_t CopyRangeTo2(
BufferedTransformation &target, lword &begin, lword end=LWORD_MAX,
const std::string &channel=DEFAULT_CHANNEL,
bool blocking=
true)
const;
68 lword Skip(lword skipMax=ULONG_MAX);
74 std::istream *m_stream;
108#if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) || _MSC_VER >= 1400
136 class OpenErr :
public Err {
public:
OpenErr(
const std::string &filename) :
Err(
"FileSink: error opening file for writing: " + filename) {}};
154#if defined(CRYPTOPP_UNIX_AVAILABLE) || _MSC_VER >= 1400
158 FileSink(
const wchar_t *filename,
bool binary=
true)
167 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
168 bool IsolatedFlush(
bool hardFlush,
bool blocking);
172 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.
FileSink(const char *filename, bool binary=true)
Construct a FileSink.
FileSink(std::ostream &out)
Construct a FileSink.
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.
FileStore(const char *filename)
Construct a FileStore.
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 ->
Abstract base classes that provide a uniform interface to this library.
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.