44#include "blocxx/BLOCXX_config.h"
134 int cnt = pptr() - pbase();
179 if (n < epptr() - pptr())
181 memcpy(pptr(), s, n *
sizeof(
char));
187 for (std::streamsize i = 0; i < n; i++)
189 if (sputc(s[i]) == EOF)
231 return static_cast<unsigned char>(*gptr());
270 return static_cast<int>(
m_tempFile.write(c, n));
282 return static_cast<int>(
m_tempFile.read(c, n));
291 return egptr() - eback();
300 rval += pptr() - pbase();
386 clear(rdstate() & ~std::ios::eofbit);
#define BLOCXX_THROW(exType, msg)
Throw an exception using FILE and LINE.
This String class is an abstract data type that represents as NULL terminated string of characters.
std::streamsize getSize()
virtual int overflow(int c)
int buffer_to_device(const char *c, int n)
std::streamsize xsputn(const char *s, std::streamsize n)
int buffer_from_device(char *c, int n)
void reset()
reset puts this stream object back into its initialized state.
void rewind()
Set the read/write position to the beginning of the data.
std::streamsize m_readPos
TempFileBuffer(size_t bufSize, EKeepFileFlag keepflg=E_DONT_KEEP_FILE)
Create a new TempFileBuffer object.
std::streamsize m_writePos
bool usingTempFile() const
String releaseFileAndReset()
releaseFileAndReset is like the reset method except it ensures all data has been flused to the underl...
void rewind()
Set the read/write position to the beginning of the data.
bool usingTempFile() const
String releaseFileAndReset()
releaseFileAndReset is like the reset method except it ensures all data has been flused to the underl...
void reset()
reset puts the underlying stream object back into its initialized state.
AutoPtr< TempFileBuffer > m_buffer
TempFileStream(size_t bufSize=4096, TempFileBuffer::EKeepFileFlag keepflg=TempFileBuffer::E_DONT_KEEP_FILE)
Create a new TempFileStream object.
BLOCXX_COMMON_API bool removeFile(const String &path)
Remove the given file.
BLOCXX_COMMON_API File createAutoDeleteTempFile(const String &dir=String())
Create a tempororary file that will be removed when the returned File object is closed.
BLOCXX_COMMON_API File createTempFile(String &filePath, const String &dir=String())
Create a tempororary file in an optional directory.