diff options
Diffstat (limited to '')
-rw-r--r-- | src/tests/myriadfs.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tests/myriadfs.cpp b/src/tests/myriadfs.cpp new file mode 100644 index 0000000..fd96c02 --- /dev/null +++ b/src/tests/myriadfs.cpp | |||
@@ -0,0 +1,26 @@ | |||
1 | #include "bu/file.h" | ||
2 | #include "bu/membuf.h" | ||
3 | #include "bu/myriadfs.h" | ||
4 | #include "bu/myriadstream.h" | ||
5 | #include "bu/sio.h" | ||
6 | |||
7 | using namespace Bu; | ||
8 | |||
9 | int main( int argc, char *argv[] ) | ||
10 | { | ||
11 | Bu::MemBuf mb; | ||
12 | Bu::MyriadFs mfs( mb, 512 ); | ||
13 | |||
14 | { | ||
15 | Bu::MyriadStream ms = mfs.open("/hello", Bu::MyriadFs::Read ); | ||
16 | ms.write("world!"); | ||
17 | } | ||
18 | |||
19 | { | ||
20 | Bu::MyriadStream ms = mfs.open("/hello", Bu::MyriadFs::Read ); | ||
21 | char buf[512]; | ||
22 | buf[ms.read( buf, 512 )] = '\0'; | ||
23 | sio << "read: '" << buf << "'" << sio.nl; | ||
24 | } | ||
25 | } | ||
26 | |||