diff options
Diffstat (limited to 'src/archive.cpp')
-rw-r--r-- | src/archive.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/archive.cpp b/src/archive.cpp index 5f5145c..be06c0e 100644 --- a/src/archive.cpp +++ b/src/archive.cpp | |||
@@ -1,13 +1,36 @@ | |||
1 | #include "archive.h" | 1 | #include "archive.h" |
2 | 2 | ||
3 | Bu::Archive::Archive(bool bLoading): | 3 | Bu::Archive::Archive( Stream &rStream, bool bLoading ) : |
4 | bLoading(bLoading) | 4 | bLoading( bLoading ), |
5 | rStream( rStream ) | ||
5 | { | 6 | { |
6 | } | 7 | } |
8 | |||
7 | Bu::Archive::~Archive() | 9 | Bu::Archive::~Archive() |
8 | { | 10 | { |
9 | } | 11 | } |
10 | 12 | ||
13 | void Bu::Archive::write( const void *pData, int32_t nSize ) | ||
14 | { | ||
15 | if( nSize == 0 || pData == NULL ) | ||
16 | return; | ||
17 | |||
18 | rStream.write( (const char *)pData, nSize ); | ||
19 | } | ||
20 | |||
21 | void Bu::Archive::read( void *pData, int32_t nSize ) | ||
22 | { | ||
23 | if( nSize == 0 || pData == NULL ) | ||
24 | return; | ||
25 | |||
26 | rStream.read( (char *)pData, nSize ); | ||
27 | } | ||
28 | |||
29 | void Bu::Archive::close() | ||
30 | { | ||
31 | rStream.close(); | ||
32 | } | ||
33 | |||
11 | bool Bu::Archive::isLoading() | 34 | bool Bu::Archive::isLoading() |
12 | { | 35 | { |
13 | return bLoading; | 36 | return bLoading; |