blocxx
|
TempFileStream is an iostream that uses an underlying temp file to hold its content to reduce memory requirements. More...
#include <TempFileStream.hpp>
Public Member Functions | |
TempFileStream (size_t bufSize=4096, TempFileBuffer::EKeepFileFlag keepflg=TempFileBuffer::E_DONT_KEEP_FILE) | |
Create a new TempFileStream object. | |
TempFileStream (const String &dir, size_t bufSize=4096, TempFileBuffer::EKeepFileFlag keepflg=TempFileBuffer::E_DONT_KEEP_FILE) | |
Create a new TempFileStream object. | |
std::streamsize | getSize () |
void | rewind () |
Set the read/write position to the beginning of the data. | |
void | reset () |
reset puts the underlying stream object back into its initialized state. | |
String | releaseFileAndReset () |
releaseFileAndReset is like the reset method except it ensures all data has been flused to the underlying file and returned name of the file if the caller requested that it not be deleted. | |
bool | usingTempFile () const |
Private Member Functions | |
TempFileStream (const TempFileStream &) | |
TempFileStream & | operator= (const TempFileStream &) |
Private Attributes | |
AutoPtr< TempFileBuffer > | m_buffer |
TempFileStream is an iostream that uses an underlying temp file to hold its content to reduce memory requirements.
The amount of data kept in memory is specified by a user supplied buffer size.
Definition at line 179 of file TempFileStream.hpp.
BLOCXX_NAMESPACE::TempFileStream::TempFileStream | ( | size_t | bufSize = 4096 , |
TempFileBuffer::EKeepFileFlag | keepflg = TempFileBuffer::E_DONT_KEEP_FILE |
||
) |
Create a new TempFileStream object.
bufSize | The desired size of the in memory buffer. This buffer becomes full, the data is written to a temp file. The default bufSize is 4K if not specified. |
keepflg | If E_KEEP_FILE is specified the temporary file used by this object will not be deleted on destruction. The caller is responsible for calling releaseFileAndReset to get the file name of the underlying temp file. If releaseFileAndReset is never called this object will attempt to delete the temp file on destruction. The default behaviour is to delete the temp file when it is closed. |
Definition at line 367 of file TempFileStream.cpp.
BLOCXX_NAMESPACE::TempFileStream::TempFileStream | ( | const String & | dir, |
size_t | bufSize = 4096 , |
||
TempFileBuffer::EKeepFileFlag | keepflg = TempFileBuffer::E_DONT_KEEP_FILE |
||
) |
Create a new TempFileStream object.
dir | This specifies where the temp file will be located. |
bufSize | The desired size of the in memory buffer. This buffer becomes full, the data is written to a temp file. The default bufSize is 4K if not specified. |
keepflg | If E_KEEP_FILE is specified the temporary file used by this object will not be deleted on destruction. The caller is responsible for calling releaseFileAndReset to get the file name of the underlying temp file. If releaseFileAndReset is never called this object will attempt to delete the temp file on destruction. The default behaviour is to delete the temp file when it is closed. |
Definition at line 374 of file TempFileStream.cpp.
BLOCXX_NAMESPACE::TempFileStream::TempFileStream | ( | const TempFileStream & | ) | [private] |
std::streamsize BLOCXX_NAMESPACE::TempFileStream::getSize | ( | ) | [inline] |
Definition at line 216 of file TempFileStream.hpp.
TempFileStream& BLOCXX_NAMESPACE::TempFileStream::operator= | ( | const TempFileStream & | ) | [private] |
String BLOCXX_NAMESPACE::TempFileStream::releaseFileAndReset | ( | ) |
releaseFileAndReset is like the reset method except it ensures all data has been flused to the underlying file and returned name of the file if the caller requested that it not be deleted.
Definition at line 397 of file TempFileStream.cpp.
References m_buffer.
void BLOCXX_NAMESPACE::TempFileStream::reset | ( | ) |
reset puts the underlying stream object back into its initialized state.
see TempFileBuffer reset.
Definition at line 390 of file TempFileStream.cpp.
References m_buffer, and BLOCXX_NAMESPACE::AutoPtr< X >::reset().
Referenced by BLOCXX_NAMESPACE::TempFileEnumerationImplBase::clear().
void BLOCXX_NAMESPACE::TempFileStream::rewind | ( | ) |
Set the read/write position to the beginning of the data.
Definition at line 382 of file TempFileStream.cpp.
References m_buffer.
bool BLOCXX_NAMESPACE::TempFileStream::usingTempFile | ( | ) | const |
Definition at line 405 of file TempFileStream.cpp.
References m_buffer.
Referenced by BLOCXX_NAMESPACE::TempFileEnumerationImplBase::usingTempFile().
Definition at line 249 of file TempFileStream.hpp.
Referenced by releaseFileAndReset(), reset(), rewind(), and usingTempFile().