44 #include "blocxx/BLOCXX_config.h" 58 , m_buffer(new char[m_bufSize])
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());
291 return egptr() - eback();
300 rval += pptr() - pbase();
386 clear(rdstate() & ~std::ios::eofbit);
TempFileBuffer(size_t bufSize, EKeepFileFlag keepflg=E_DONT_KEEP_FILE)
Create a new TempFileBuffer object.
void reset()
reset puts this 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 underl...
void reset()
reset puts the underlying stream object back into its initialized state.
This String class is an abstract data type that represents as NULL terminated string of characters...
void rewind()
Set the read/write position to the beginning of the data.
String releaseFileAndReset()
releaseFileAndReset is like the reset method except it ensures all data has been flused to the underl...
bool usingTempFile() const
Int64 seek(Int64 offset, int whence) const
Seek to a given offset within the file.
BLOCXX_COMMON_API bool removeFile(const String &path)
Remove the given file.
UInt64 size() const
Current size of file.
int close()
Close the underlying file object.
std::streamsize m_readPos
void rewind()
Set the read/write position to the beginning of the data.
virtual int overflow(int c)
int buffer_from_device(char *c, int n)
String & erase()
Delete all the characters of the string.
int buffer_to_device(const char *c, int n)
AutoPtr< TempFileBuffer > m_buffer
#define BLOCXX_THROW(exType, msg)
Throw an exception using FILE and LINE.
BLOCXX_COMMON_API File createTempFile(String &filePath, const String &dir=String())
Create a tempororary file in an optional directory.
size_t read(void *bfr, size_t numberOfBytes, Int64 offset=-1L) const
Read from the underlying file.
TempFileStream(size_t bufSize=4096, TempFileBuffer::EKeepFileFlag keepflg=TempFileBuffer::E_DONT_KEEP_FILE)
Create a new TempFileStream object.
std::streamsize xsputn(const char *s, std::streamsize n)
BLOCXX_COMMON_API File createAutoDeleteTempFile(const String &dir=String())
Create a tempororary file that will be removed when the returned File object is closed.
size_t write(const void *bfr, size_t numberOfBytes, Int64 offset=-1L)
Write to the underlying file.
std::streamsize getSize()
bool usingTempFile() const
std::streamsize m_writePos