Go to the documentation of this file.
38 #include "blocxx/BLOCXX_config.h"
49 const UInt32 TEMPFILE_ENUMERATION_SIG = 0x4f57454e;
55 UInt32 enumSig = TEMPFILE_ENUMERATION_SIG;
56 m_Data.write(
reinterpret_cast<const char*
>(&enumSig),
sizeof(enumSig));
59 BLOCXX_THROW(EnumerationException,
"Failed to write signature to "
60 "enumeration tempfile.");
65 m_Data.read(
reinterpret_cast<char*
>(&tmpSig),
sizeof(tmpSig));
68 BLOCXX_THROW(EnumerationException,
"Failed to read signature from "
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))
147 BLOCXX_THROW (EnumerationException,
"Attempt to Extract from empty Enum");
bool usingTempFile() const
void reset()
reset puts the underlying stream object back into its initialized state.
#define BLOCXX_THROW(exType, msg)
Throw an exception using FILE and LINE.
void throwIfEmpty() const
size_t numberOfElements() const
TempFileEnumerationImplBase()
int close()
Close the underlying file object.
bool usingTempFile() const
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.
size_t read(void *bfr, size_t numberOfBytes, Int64 offset=-1L) const
Read from the underlying file.
bool hasMoreElements() const
The purpose of the File class is to provide an abstraction layer over the platform dependant function...
size_t readSize(String const &filename)
virtual ~TempFileEnumerationImplBase()
Int64 seek(Int64 offset, int whence) const
Seek to a given offset within the file.