38 #include "blocxx/BLOCXX_config.h"
44 namespace BLOCXX_NAMESPACE
49 const UInt32 TEMPFILE_ENUMERATION_SIG = 0x4f57454e;
55 UInt32 enumSig = TEMPFILE_ENUMERATION_SIG;
56 m_Data.write(reinterpret_cast<const char*>(&enumSig),
sizeof(enumSig));
60 "enumeration tempfile.");
65 m_Data.read(reinterpret_cast<char*>(&tmpSig),
sizeof(tmpSig));
69 "enumeration tempfile.");
112 if (f.
read(reinterpret_cast<char*>(&fileSig),
sizeof(fileSig)) !=
sizeof(fileSig))
117 if (fileSig != TEMPFILE_ENUMERATION_SIG)
120 "enumeration from a file that does not have the correct "
124 off_t whence = f.
seek(-static_cast<off_t>(
sizeof(size)), SEEK_END);
129 if (f.
read(reinterpret_cast<char*>(&size),
sizeof(size), whence) !=
sizeof(size))
virtual ~TempFileEnumerationImplBase()
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...
bool hasMoreElements() const
size_t numberOfElements() const
bool usingTempFile() const
bool usingTempFile() const
Int64 seek(Int64 offset, int whence) const
Seek to a given offset within the file.
TempFileEnumerationImplBase()
int close()
Close the underlying file object.
void throwIfEmpty() const
The purpose of the File class is to provide an abstraction layer over the platform dependant function...
#define BLOCXX_THROW(exType, msg)
Throw an exception using FILE and LINE.
size_t read(void *bfr, size_t numberOfBytes, Int64 offset=-1L) const
Read from the underlying file.
size_t readSize(String const &filename)
BLOCXX_COMMON_API File openFile(const String &path)
Open a file for read/write and return an File object that can be used for reading and writing...