cgv
|
#include <big_binary_file.h>
Public Member Functions | |
big_binary_file (const std::string &filename="") | |
assosiates the new instance to the file filename | |
virtual | ~big_binary_file () |
close the file (if it is still opened) | |
bool | open (MODE m, const std::string &file_name="") |
open a file in read or write mode | |
void | close () |
close the file | |
bool | is_open () |
return true if the file is opened | |
long long | size () |
return the size of the file in bytes | |
bool | read (unsigned char *targetbuffer, unsigned long num, unsigned long *numread=NULL) |
read num bytes from the file into the targetbuffer | |
bool | write (const unsigned char *sourcebuffer, unsigned long num, unsigned long *numwrote=NULL) |
write num bytes to the file from the sourcebuffer (file must be opened with write access first) | |
template<typename T > | |
bool | read (T &v) |
read a typedef value | |
template<typename T > | |
bool | read_array (T *a, unsigned int n) |
read an array of typed values | |
template<typename T > | |
bool | write (const T &v) |
write a typedef value | |
template<typename T > | |
bool | write_array (const T *a, unsigned int n) |
write an array of typed values | |
long long | position () |
return the position of the file pointer in bytes | |
class to handle files with very large sizes (>=2GB) hiding the ugly win32 api calls
linux-support by using 64bit pointer, LFS required in kernel