A file in the memory.
Inheritance:
Public Fields
-
MemoryXFileList* memory
- The memory
-
int position
- The position in the memory
-
int size
- The size of the memory
-
int total_size
- The total size of the memory, including allocated buffer
-
int buffer_size
- Minimal number of bytes that will be allocated when writing
Public Methods
-
MemoryXFile(int buffer_format_size_=256)
- Create a read-write file from nothing
-
MemoryXFile(MemoryXFileList* memory_, int size_=-1, int buffer_format_size_=256)
- Give a MemoryXFileList for the memory.
-
MemoryXFile(void* memory_, int size_, int buffer_format_size_=256)
- Give a pointer for the memory.
-
void concat()
- Concat all the memory in one node.
-
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
-
virtual int read(void* ptr, int block_size, int n_blocks)
-
virtual int write(void* ptr, int block_size, int n_blocks)
-
int taggedRead(void* ptr, int block_size, int n_blocks, const char* tag)
-
int taggedWrite(void* ptr, int block_size, int n_blocks, const char* tag)
-
virtual int eof()
-
virtual int flush()
-
virtual int seek(long offset, int whence)
-
virtual long tell()
-
virtual void rewind()
-
virtual int printf(const char* format, ...)
-
virtual char* gets(char* dest, int size_)
Inherited from Object:
Public Fields
-
Allocator* allocator
Public Methods
-
void addOption(const char* name, int size, void* ptr, const char* help="")
-
void addIOption(const char* name, int* ptr, int init_value, const char* help="")
-
void addROption(const char* name, real* ptr, real init_value, const char* help="")
-
void addBOption(const char* name, bool* ptr, bool init_value, const char* help="")
-
void addOOption(const char* name, Object** ptr, Object* init_value, const char* help="")
-
void setOption(const char* name, void* ptr)
-
void setIOption(const char* name, int option)
-
void setROption(const char* name, real option)
-
void setBOption(const char* name, bool option)
-
void setOOption(const char* name, Object* option)
-
virtual void loadXFile(XFile* file)
-
virtual void saveXFile(XFile* file)
-
void load(const char* filename)
-
void save(const char* filename)
-
void* operator new(size_t size, Allocator* allocator_=NULL)
-
void* operator new(size_t size, Allocator* allocator_, void* ptr_)
-
void 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]
|
- MemoryXFileList* memory
- The memory
- int position
- The position in the memory
- int size
- The size of the memory
- int total_size
- The total size of the memory, including allocated buffer
- int buffer_size
- Minimal number of bytes that will be allocated when writing
- MemoryXFile(int buffer_format_size_=256)
- Create a read-write file from nothing
- 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_
- MemoryXFile(void* memory_, int size_, int buffer_format_size_=256)
- Give a pointer for the memory. (No copy is done!)
- void 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.
- 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.
- 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++.