diff options
Diffstat (limited to 'src/stable/archivebase.h')
-rw-r--r-- | src/stable/archivebase.h | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/src/stable/archivebase.h b/src/stable/archivebase.h deleted file mode 100644 index d846c27..0000000 --- a/src/stable/archivebase.h +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2019 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
8 | #ifndef BU_ARCHIVE_BASE_H | ||
9 | #define BU_ARCHIVE_BASE_H | ||
10 | |||
11 | #include <stdint.h> | ||
12 | #include <unistd.h> | ||
13 | |||
14 | #include "bu/variant.h" | ||
15 | #include "bu/blob.h" | ||
16 | |||
17 | namespace Bu | ||
18 | { | ||
19 | class ArchiveBase | ||
20 | { | ||
21 | public: | ||
22 | ArchiveBase(); | ||
23 | virtual ~ArchiveBase(); | ||
24 | |||
25 | virtual void close()=0; | ||
26 | virtual void write( const void *pData, size_t iLength )=0; | ||
27 | virtual void read( void *pData, size_t iLength )=0; | ||
28 | virtual bool isLoading()=0; | ||
29 | |||
30 | virtual void setProperty( const Bu::Blob &rKey, | ||
31 | const Bu::Variant &rValue )=0; | ||
32 | virtual Bu::Variant getProperty( const Bu::Blob &rKey ) const=0; | ||
33 | }; | ||
34 | |||
35 | template<typename T> ArchiveBase &operator&&( ArchiveBase &ar, T &dat ) | ||
36 | { | ||
37 | if( ar.isLoading() ) | ||
38 | { | ||
39 | return ar >> dat; | ||
40 | } | ||
41 | else | ||
42 | { | ||
43 | return ar << dat; | ||
44 | } | ||
45 | } | ||
46 | |||
47 | ArchiveBase &operator<<( ArchiveBase &ar, bool p ); | ||
48 | ArchiveBase &operator<<( ArchiveBase &ar, char p ); | ||
49 | ArchiveBase &operator<<( ArchiveBase &ar, signed char p ); | ||
50 | ArchiveBase &operator<<( ArchiveBase &ar, unsigned char p ); | ||
51 | ArchiveBase &operator<<( ArchiveBase &ar, signed short p ); | ||
52 | ArchiveBase &operator<<( ArchiveBase &ar, unsigned short p ); | ||
53 | ArchiveBase &operator<<( ArchiveBase &ar, signed int p ); | ||
54 | ArchiveBase &operator<<( ArchiveBase &ar, unsigned int p ); | ||
55 | ArchiveBase &operator<<( ArchiveBase &ar, signed long p ); | ||
56 | ArchiveBase &operator<<( ArchiveBase &ar, unsigned long p ); | ||
57 | ArchiveBase &operator<<( ArchiveBase &ar, signed long long p ); | ||
58 | ArchiveBase &operator<<( ArchiveBase &ar, unsigned long long p ); | ||
59 | ArchiveBase &operator<<( ArchiveBase &ar, float p ); | ||
60 | ArchiveBase &operator<<( ArchiveBase &ar, double p ); | ||
61 | ArchiveBase &operator<<( ArchiveBase &ar, long double p ); | ||
62 | |||
63 | ArchiveBase &operator>>( ArchiveBase &ar, bool &p ); | ||
64 | ArchiveBase &operator>>( ArchiveBase &ar, char &p ); | ||
65 | ArchiveBase &operator>>( ArchiveBase &ar, signed char &p ); | ||
66 | ArchiveBase &operator>>( ArchiveBase &ar, unsigned char &p ); | ||
67 | ArchiveBase &operator>>( ArchiveBase &ar, signed short &p ); | ||
68 | ArchiveBase &operator>>( ArchiveBase &ar, unsigned short &p ); | ||
69 | ArchiveBase &operator>>( ArchiveBase &ar, signed int &p ); | ||
70 | ArchiveBase &operator>>( ArchiveBase &ar, unsigned int &p ); | ||
71 | ArchiveBase &operator>>( ArchiveBase &ar, signed long &p ); | ||
72 | ArchiveBase &operator>>( ArchiveBase &ar, unsigned long &p ); | ||
73 | ArchiveBase &operator>>( ArchiveBase &ar, signed long long &p ); | ||
74 | ArchiveBase &operator>>( ArchiveBase &ar, unsigned long long &p ); | ||
75 | ArchiveBase &operator>>( ArchiveBase &ar, float &p ); | ||
76 | ArchiveBase &operator>>( ArchiveBase &ar, double &p ); | ||
77 | ArchiveBase &operator>>( ArchiveBase &ar, long double &p ); | ||
78 | }; | ||
79 | |||
80 | #endif | ||