Go to the documentation of this file.
39 #ifndef BLOCXX_FILE_HPP_INCLUDE_GUARD_
40 #define BLOCXX_FILE_HPP_INCLUDE_GUARD_
41 #include "blocxx/BLOCXX_config.h"
54 class BLOCXX_COMMON_API File
93 File& operator= (
const File& x)
113 size_t read(
void* bfr,
size_t numberOfBytes, Int64 offset=-1L)
const
127 size_t write(
const void* bfr,
size_t numberOfBytes, Int64 offset=-1L)
141 Int64
seek(Int64 offset,
int whence)
const
204 int getLock(ELockType type = E_WRITE_LOCK);
220 int tryLock(ELockType type = E_WRITE_LOCK);
241 return m_hdl == rhs.
m_hdl;
BLOCXX_COMMON_API Int64 seek(const FileHandle &hdl, Int64 offset, int whence)
Seek to a given offset within the file.
BLOCXX_COMMON_API size_t write(FileHandle hdl, const void *bfr, size_t numberOfBytes, Int64 offset=-1L)
Write data to a file.
#define BLOCXX_SAFE_BOOL_IMPL(classname, type, variable, test)
void write(std::streambuf &ostrm, void const *dataOut, size_t dataOutLen)
void read(std::streambuf &istrm, void *dataIn, size_t dataInLen)
void swap(Array< T > &x, Array< T > &y)
BLOCXX_COMMON_API void rewind(const FileHandle &hdl)
Position the file pointer associated with the given file handle to the beginning of the file.
BLOCXX_COMMON_API int close(const FileHandle &hdl)
Close file handle.
BLOCXX_COMMON_API int flush(FileHandle &hdl)
Flush any buffered data to the file if buffering supported.
bool operator==(const Array< T > &x, const Array< T > &y)
The purpose of the File class is to provide an abstraction layer over the platform dependant function...
#define BLOCXX_INVALID_FILEHANDLE
BLOCXX_COMMON_API Int64 tell(const FileHandle &hdl)
BLOCXX_COMMON_API size_t read(const FileHandle &hdl, void *bfr, size_t numberOfBytes, Int64 offset=-1L)
Read data from file.
BLOCXX_COMMON_API UInt64 fileSize(FileHandle fh)
Get the size of a file from the file handle.