7#ifndef CRYPTOPP_FILES_H
8#define CRYPTOPP_FILES_H
18NAMESPACE_BEGIN(CryptoPP)
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)
42 {StoreInitialize(
MakeParameters(Name::InputStreamPointer(), &in));}
46 FileStore(
const char *filename) : m_stream(NULLPTR), m_space(NULLPTR), m_len(0), m_waiting(0)
47 {StoreInitialize(
MakeParameters(Name::InputFileName(), filename ? filename :
""));}
49#if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) || _MSC_VER >= 1400
54 {StoreInitialize(
MakeParameters(Name::InputFileNameWide(), filename));}
63 const std::istream*
GetStream()
const {
return m_stream;}
69 lword MaxRetrievable()
const;
70 size_t TransferTo2(
BufferedTransformation &target,
lword &transferBytes,
const std::string &channel=DEFAULT_CHANNEL,
bool blocking=
true);
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;
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(const char *filename, bool pumpAll, BufferedTransformation *attachment=NULLPTR, bool binary=true)
Construct a FileSource.
std::istream * GetStream()
Retrieves the internal stream.
FileSource(std::istream &in, bool pumpAll, BufferedTransformation *attachment=NULLPTR)
Construct a FileSource.
FileSource(BufferedTransformation *attachment=NULLPTR)
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.
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.
Implementation of BufferedTransformation's attachment interface.
Classes for automatic resource management.
Create a working space in a BufferedTransformation.