class MemoryXFile

A file in the memory.

Inheritance:


Public Fields

[more]MemoryXFileList* memory
The memory
[more]int position
The position in the memory
[more]int size
The size of the memory
[more]int total_size
The total size of the memory, including allocated buffer
[more]int buffer_size
Minimal number of bytes that will be allocated when writing

Public Methods

[more] MemoryXFile(int buffer_format_size_=256)
Create a read-write file from nothing
[more] MemoryXFile(MemoryXFileList* memory_, int size_=-1, int buffer_format_size_=256)
Give a MemoryXFileList for the memory.
[more] MemoryXFile(void* memory_, int size_, int buffer_format_size_=256)
Give a pointer for the memory.
[more]void concat()
Concat all the memory in one node.
[more]virtual int scanf(const char* format, void* ptr)
Warning: this method call the concat function, and therefore could take time if you do intensive read/write.


Inherited from XFile:

Public Methods

ovirtual int read(void* ptr, int block_size, int n_blocks)
ovirtual int write(void* ptr, int block_size, int n_blocks)
oint taggedRead(void* ptr, int block_size, int n_blocks, const char* tag)
oint taggedWrite(void* ptr, int block_size, int n_blocks, const char* tag)
ovirtual int eof()
ovirtual int flush()
ovirtual int seek(long offset, int whence)
ovirtual long tell()
ovirtual void rewind()
ovirtual int printf(const char* format, ...)
ovirtual char* gets(char* dest, int size_)


Inherited from Object:

Public Fields

oAllocator* allocator

Public Methods

ovoid addOption(const char* name, int size, void* ptr, const char* help="")
ovoid addIOption(const char* name, int* ptr, int init_value, const char* help="")
ovoid addROption(const char* name, real* ptr, real init_value, const char* help="")
ovoid addBOption(const char* name, bool* ptr, bool init_value, const char* help="")
ovoid addOOption(const char* name, Object** ptr, Object* init_value, const char* help="")
ovoid setOption(const char* name, void* ptr)
ovoid setIOption(const char* name, int option)
ovoid setROption(const char* name, real option)
ovoid setBOption(const char* name, bool option)
ovoid setOOption(const char* name, Object* option)
ovirtual void loadXFile(XFile* file)
ovirtual void saveXFile(XFile* file)
ovoid load(const char* filename)
ovoid save(const char* filename)
ovoid* operator new(size_t size, Allocator* allocator_=NULL)
ovoid* operator new(size_t size, Allocator* allocator_, void* ptr_)
ovoid operator delete(void* ptr)


Documentation

A file in the memory. Note that the MemoryXFile is a read-write file! When writing, data is buffered (to avoid reallocating blocks of small sizes!).

Options:
"buffer size" int buffer size for writing [65536]

oMemoryXFileList* memory
The memory

oint position
The position in the memory

oint size
The size of the memory

oint total_size
The total size of the memory, including allocated buffer

oint buffer_size
Minimal number of bytes that will be allocated when writing

o MemoryXFile(int buffer_format_size_=256)
Create a read-write file from nothing

o MemoryXFile(MemoryXFileList* memory_, int size_=-1, int buffer_format_size_=256)
Give a MemoryXFileList for the memory. A new list is created, but the memory in the nodes are not copied. If the size that you want to be readable is less than the sum of the n in the field of the MemoryXFileList, you can provide it in size_

o MemoryXFile(void* memory_, int size_, int buffer_format_size_=256)
Give a pointer for the memory. (No copy is done!)

ovoid concat()
Concat all the memory in one node. Add a null character at the end. This null character is useful for sscanf in the scanf method.

ovirtual int scanf(const char* format, void* ptr)
Warning: this method call the concat function, and therefore could take time if you do intensive read/write.


This class has no child classes.
Author:
Ronan Collobert (collober@idiap.ch)

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.