cgv
|
class to handle files with very large sizes (>=2GB) hiding the ugly win32 api calls More...
#include <big_binary_file.h>
Public Types | |
enum | MODE { READ = 1 , WRITE = 2 , READ_WRITE = 3 } |
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 | |
bool | seek (long long index) |
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
Definition at line 14 of file big_binary_file.h.
enum cgv::utils::big_binary_file::MODE |
Definition at line 17 of file big_binary_file.h.
|
inline |
read a typedef value
Definition at line 52 of file big_binary_file.h.
References read().
Referenced by read().
|
inline |
read an array of typed values
Definition at line 55 of file big_binary_file.h.
|
inline |
write a typedef value
Definition at line 59 of file big_binary_file.h.
References write().
Referenced by write().
|
inline |
write an array of typed values
Definition at line 62 of file big_binary_file.h.