aboutsummaryrefslogtreecommitdiff
path: root/nerv/doc/nerv_io.md
diff options
context:
space:
mode:
Diffstat (limited to 'nerv/doc/nerv_io.md')
-rw-r--r--nerv/doc/nerv_io.md13
1 files changed, 7 insertions, 6 deletions
diff --git a/nerv/doc/nerv_io.md b/nerv/doc/nerv_io.md
index 07589df..299362f 100644
--- a/nerv/doc/nerv_io.md
+++ b/nerv/doc/nerv_io.md
@@ -1,7 +1,7 @@
-#The Nerv IO Package#
+# The Nerv IO Package
Part of the [Nerv](../README.md) toolkit.
-##Description##
+## Description
The main class that the user uses to store and read parameter object to and from files is __nerv.ChunkFile__.
In the file, a parameter object will be saved using a standard format. First is the length(in byte) of this object, then a table which includes some meta information of the object, and a data area. Below is an example text file.
```
@@ -23,7 +23,7 @@ In the file, a parameter object will be saved using a standard format. First is
3.000000 3.000000 3.000000
```
-##Methods##
+## Methods
* __ChunkFile ChunkFile(string fn, string mode)__
`mode` can be `r` or `w`, for reading or writing a file. The returned __ChunkFile__ will be ready to write or read objects which follows the __nerv.Param__ interface(using `write_chunk` and `read_chunk`).
* __void ChunkFile.write_chunk(ChunkFile self, Param p)__
@@ -33,7 +33,7 @@ Read the __Param__ object by id `id` from the file `self`. It will be constructe
* __void ChunkFile.close(ChunkFile self)__
Close the opened file.
-##Examples##
+## Examples
* An example showing how to use __ChunkFile__ to store and read parameter objects.
```
require 'io'
@@ -96,7 +96,7 @@ do
end
```
-##Developer Notes##
+## Developer Notes
* There are four classes in to deal with chunk data, which are __nerv.ChunkFile__, __nerv.ChunkFileHandle__, __nerv.ChunkInfo__, __nerv.ChunkData__. Below is the underlying C structs.
```
typedef struct ChunkFileHandle {
@@ -110,4 +110,5 @@ typedef struct ChunkData {
char *data;
} ChunkData;
```
-* In __Nerv.io__, a returned(by `ChunkFile.__init`) __nerv.ChunkFile__ will have a member `handle`, which is a __nerv.ChunkFileHandle__. \ No newline at end of file
+
+* In __Nerv.io__, a returned(by `ChunkFile.__init`) __nerv.ChunkFile__ will have a member `handle`, which is a __nerv.ChunkFileHandle__.