MADNESS 0.10.1
|
Wraps an archive around a text filestream for output. More...
#include <text_fstream_archive.h>
Public Member Functions | |
TextFstreamOutputArchive (const char *filename=nullptr, std::ios_base::openmode mode=std::ios_base::binary|std::ios_base::out|std::ios_base::trunc) | |
Default constructor. | |
~TextFstreamOutputArchive () | |
Destructor. | |
void | close () |
Close the filestream. | |
void | flush () |
Flush the filestream. | |
void | open (const char *filename, std::ios_base::openmode mode=std::ios_base::out|std::ios_base::trunc) |
Open the filestream. | |
void | store (const char *t, long) const |
Store a character string, escaping '&', '<' and '> along the way. | |
template<class T > | |
std::enable_if< madness::is_ostreammable_v< T > >::type | store (const T *t, long n) const |
Store data to the filestream. | |
void | store (const unsigned char *t, long n) const |
Store a character string, without escaping characters. | |
template<class T > | |
void | store_end_tag () const |
Closes the "cookie" tag for runtime type-checking. | |
template<class T > | |
void | store_start_tag () const |
Stores the cookie for runtime type-checking into the archive as a tag. | |
Public Member Functions inherited from madness::archive::BaseArchive | |
BaseArchive () | |
Private Attributes | |
std::ofstream | os |
The filestream. | |
Additional Inherited Members | |
Public Types inherited from madness::archive::BaseOutputArchive | |
using | is_saving = std::true_type |
Type used by Boost.Serialization to determine if this object is an output archive. | |
Public Types inherited from madness::archive::BaseArchive | |
using | is_loading = std::false_type |
Type used by Boost.Serialization to determine if this object is an input archive. | |
using | is_saving = std::false_type |
Type used by Boost.Serialization to determine if this object is an output archive. | |
Static Public Attributes inherited from madness::archive::BaseOutputArchive | |
static constexpr bool | is_output_archive = true |
Flag to determine if this object is an output archive. | |
Static Public Attributes inherited from madness::archive::BaseArchive | |
static constexpr bool | is_archive = true |
Flag to determine if this object is an archive. | |
static constexpr bool | is_input_archive = false |
Flag to determine if this object is an input archive. | |
static constexpr bool | is_output_archive = false |
Flag to determine if this object is an output archive. | |
static constexpr bool | is_parallel_archive = false |
Flag to determine if this object is a parallel archive. | |
Wraps an archive around a text filestream for output.
|
inline |
Default constructor.
The filename and open modes are optional here; they can be specified later by calling open()
.
[in] | filename | Name of the file to write to. |
[in] | mode | I/O attributes for opening the file. |
References madness::filename, and open().
|
inline |
Destructor.
References close().
void madness::archive::TextFstreamOutputArchive::close | ( | ) |
|
inline |
Flush the filestream.
References os.
void madness::archive::TextFstreamOutputArchive::open | ( | const char * | filename, |
std::ios_base::openmode | mode = std::ios_base::out | std::ios_base::trunc |
||
) |
Open the filestream.
[in] | filename | The name of the file. |
[in] | mode | I/O attributes for opening the file. |
References ARCHIVE_MAJOR_VERSION, ARCHIVE_MINOR_VERSION, madness::archive::archive_type_names, bufsize, madness::filename, os, and store().
Referenced by TextFstreamOutputArchive().
void madness::archive::TextFstreamOutputArchive::store | ( | const char * | t, |
long | |||
) | const |
|
inline |
|
inline |
Store a character string, without escaping characters.
[in] | t | The character string. |
[in] | n | The number of characters to store. |
References os.
|
inline |
Closes the "cookie" tag for runtime type-checking.
T | The type of data to be stored between the tags. |
Referenced by madness::archive::ArchivePrePostImpl< TextFstreamOutputArchive, T >::postamble_store().
|
inline |
Stores the cookie for runtime type-checking into the archive as a tag.
T | The type of data to be stored between the tags. |
References bufsize, MAD_ARCHIVE_DEBUG, and os.
Referenced by madness::archive::ArchivePrePostImpl< TextFstreamOutputArchive, T >::preamble_store().
|
mutableprivate |
The filestream.
Referenced by close(), flush(), open(), store(), store(), store(), store_end_tag(), and store_start_tag().