SHOGUN v0.9.0
|
memory mapped emulation via binary streams (files)
Implements memory mapped file emulation (
在文件BinaryStream.h第27行定义。
公有成员 | |
CBinaryStream () | |
CBinaryStream (const char *fname, const char *flag="r") | |
CBinaryStream (const CBinaryStream &bs) | |
virtual | ~CBinaryStream () |
void | open_stream (const char *fname, const char *flag="r") |
void | close_stream () |
uint64_t | get_length () |
uint64_t | get_size () |
char * | get_line (uint64_t &len, uint64_t &offs) |
int32_t | get_num_lines () |
void | pre_buffer (T *buffer, long index, long num) const |
T | read_next () const |
T | operator[] (int32_t index) const |
virtual const char * | get_name () const |
保护属性 | |
FILE * | fd |
uint64_t | length |
char * | rw |
char * | m_fname |
CBinaryStream | ( | ) |
default constructor
在文件BinaryStream.h第32行定义。
CBinaryStream | ( | const char * | fname, |
const char * | flag = "r" |
||
) |
constructor
open a file for read mode
fname | name of file, zero terminated string |
flag | determines read or read write mode (currently only 'r' is supported) |
在文件BinaryStream.h第47行定义。
CBinaryStream | ( | const CBinaryStream< T > & | bs | ) |
virtual ~CBinaryStream | ( | ) | [virtual] |
destructor
在文件BinaryStream.h第67行定义。
void close_stream | ( | ) |
close a file stream
在文件BinaryStream.h第95行定义。
uint64_t get_length | ( | ) |
get the number of objects of type T cointained in the file
在文件BinaryStream.h第112行定义。
char* get_line | ( | uint64_t & | len, |
uint64_t & | offs | ||
) |
get next line from file
The returned line may be modfied in case the file was opened read/write. It is otherwise read-only.
len | length of line (returned via reference) |
offs | offset to be passed for reading next line, should be 0 initially (returned via reference) |
在文件BinaryStream.h第137行定义。
virtual const char* get_name | ( | void | ) | const [virtual] |
int32_t get_num_lines | ( | ) |
uint64_t get_size | ( | ) |
void open_stream | ( | const char * | fname, |
const char * | flag = "r" |
||
) |
T operator[] | ( | int32_t | index | ) | const |
operator overload for file read only access
index | index |
在文件BinaryStream.h第192行定义。
void pre_buffer | ( | T * | buffer, |
long | index, | ||
long | num | ||
) | const |
read num elements starting from index into buffer
buffer | buffer that has to be at least num elements long |
index | index into file starting from which elements are read |
num | number of elements to be read |
在文件BinaryStream.h第157行定义。
T read_next | ( | ) | const |
FILE* fd [protected] |
file descriptor
在文件BinaryStream.h第211行定义。
uint64_t length [protected] |
size of file
在文件BinaryStream.h第213行定义。
char* m_fname [protected] |
fname
在文件BinaryStream.h第217行定义。
char* rw [protected] |
mode
在文件BinaryStream.h第215行定义。