diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-04-03 05:09:12 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-04-03 05:09:12 +0000 |
commit | c884da672645231b5ec47706c886381dab1b391a (patch) | |
tree | f9c0a0c4fb9006c2c1aa10c8c65de2f6e42894de /src/archive.h | |
parent | da89e6d30e57bd6dbb10b4d36b093ce9bbf5c666 (diff) | |
download | libbu++-c884da672645231b5ec47706c886381dab1b391a.tar.gz libbu++-c884da672645231b5ec47706c886381dab1b391a.tar.bz2 libbu++-c884da672645231b5ec47706c886381dab1b391a.tar.xz libbu++-c884da672645231b5ec47706c886381dab1b391a.zip |
The file stream is imported and works, as does our first test, and the new
tweaks to archive. The && operator is now a template function, and as such
requires no special handling. It could be worth it to check this out for other
types, yet dangerous, since it would let you archive anything, even a class,
without writing the proper functions for it...we shall see what happens...
Diffstat (limited to '')
-rw-r--r-- | src/archive.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/archive.h b/src/archive.h index 7de9220..26e430b 100644 --- a/src/archive.h +++ b/src/archive.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <stdint.h> | 4 | #include <stdint.h> |
5 | #include <string> | 5 | #include <string> |
6 | #include "archable.h" | 6 | #include "archable.h" |
7 | #include "stream.h" | ||
7 | 8 | ||
8 | namespace Bu | 9 | namespace Bu |
9 | { | 10 | { |
@@ -20,12 +21,12 @@ namespace Bu | |||
20 | save = false | 21 | save = false |
21 | }; | 22 | }; |
22 | 23 | ||
23 | Archive( bool bLoading ); | 24 | Archive( Stream &rStream, bool bLoading ); |
24 | virtual ~Archive(); | 25 | virtual ~Archive(); |
25 | virtual void close()=0; | 26 | virtual void close(); |
26 | 27 | ||
27 | virtual void write(const void *, int32_t)=0; | 28 | virtual void write(const void *, int32_t); |
28 | virtual void read(void *, int32_t)=0; | 29 | virtual void read(void *, int32_t); |
29 | 30 | ||
30 | virtual Archive &operator<<(bool); | 31 | virtual Archive &operator<<(bool); |
31 | virtual Archive &operator<<(int8_t); | 32 | virtual Archive &operator<<(int8_t); |
@@ -67,6 +68,9 @@ namespace Bu | |||
67 | virtual Archive &operator&&(float &); | 68 | virtual Archive &operator&&(float &); |
68 | virtual Archive &operator&&(double &); | 69 | virtual Archive &operator&&(double &); |
69 | virtual Archive &operator&&(long double &); | 70 | virtual Archive &operator&&(long double &); |
71 | |||
72 | private: | ||
73 | Stream &rStream; | ||
70 | }; | 74 | }; |
71 | 75 | ||
72 | Archive &operator<<(Archive &, class Bu::Archable &); | 76 | Archive &operator<<(Archive &, class Bu::Archable &); |