7 #ifndef CRYPTOPP_FILES_H 8 #define CRYPTOPP_FILES_H 33 class OpenErr :
public Err {
public:
OpenErr(
const std::string &filename) :
Err(
"FileStore: error opening file for reading: " + filename) {}};
38 FileStore() : m_stream(NULL), m_space(NULL), m_len(0), m_waiting(0) {}
42 FileStore(std::istream &in) : m_stream(NULL), m_space(NULL), m_len(0), m_waiting(0)
43 {StoreInitialize(
MakeParameters(Name::InputStreamPointer(), &in));}
47 FileStore(
const char *filename) : m_stream(NULL), m_space(NULL), m_len(0), m_waiting(0)
48 {StoreInitialize(
MakeParameters(Name::InputFileName(), filename ? filename :
""));}
50 #if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) || _MSC_VER >= 1400 55 {StoreInitialize(
MakeParameters(Name::InputFileNameWide(), filename));}
62 lword MaxRetrievable()
const;
106 #if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) || _MSC_VER >= 1400 135 class OpenErr :
public Err {
public:
OpenErr(
const std::string &filename) :
Err(
"FileSink: error opening file for writing: " + filename) {}};
145 {IsolatedInitialize(
MakeParameters(Name::OutputStreamPointer(), &out));}
151 {IsolatedInitialize(
MakeParameters(Name::OutputFileName(), filename)(Name::OutputBinaryMode(), binary));}
153 #if defined(CRYPTOPP_UNIX_AVAILABLE) || _MSC_VER >= 1400 154 FileSink(
const wchar_t *filename,
bool binary=
true)
158 {IsolatedInitialize(
MakeParameters(Name::OutputFileNameWide(), filename)(Name::OutputBinaryMode(), binary));}
166 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking);
167 bool IsolatedFlush(
bool hardFlush,
bool blocking);
Create a working space in a BufferedTransformation.
Base class for all exceptions thrown by the library.
Standard names for retrieving values by name when working with NameValuePairs.
FileStore::OpenErr OpenErr
std::istream * GetStream()
Retrieves the internal stream.
member_ptr< std::ofstream > m_file
OpenErr(const std::string &filename)
Implementation of Store interface.
FileStore()
Construct a FileStore.
#define NAMESPACE_BEGIN(x)
Abstract base classes that provide a uniform interface to this library.
Classes for automatic resource management.
Acts as a Source for pre-existing, static data.
FileSource(const char *filename, bool pumpAll, BufferedTransformation *attachment=NULL, bool binary=true)
Construct a FileSource.
FileSink(std::ostream &out)
Construct a FileSink.
FileSink(const char *filename, bool binary=true)
Construct a FileSink.
const std::string DEFAULT_CHANNEL
Default channel for BufferedTransformation.
FileSource(BufferedTransformation *attachment=NULL)
Construct a FileSource.
Transform a Store into a Source.
AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)
Create an object that implements NameValuePairs.
FileStore(std::istream &in)
Construct a FileStore.
Exception thrown when file-based write error is encountered.
FileStore(const char *filename)
Construct a FileStore.
Exception thrown when file-based error is encountered.
OpenErr(const std::string &filename)
member_ptr< std::ifstream > m_file
Implementation of BufferedTransformation's attachment interface.
Implementation of Store interface.
Err(const std::string &s)
std::istream * GetStream()
Retrieves the internal stream.
Exception thrown when file-based open error is encountered.
std::ostream * GetStream()
Retrieves the internal stream.
FileSink()
Construct a FileSink.
Err(const std::string &s)
Implementation of BufferedTransformation's attachment interface.
FileStore::ReadErr ReadErr
std::vector< char * > parameters
FileSource(std::istream &in, bool pumpAll, BufferedTransformation *attachment=NULL)
Construct a FileSource.
Implementation of Store interface.
Exception thrown when file-based read error is encountered.
Ensures an object is not copyable.
Exception thrown when file-based error is encountered.
Interface for retrieving values given their names.
Exception thrown when file-based open error is encountered.