diff options
author | Mike Buland <mbuland@penny-arcade.com> | 2022-04-20 11:14:47 -0700 |
---|---|---|
committer | Mike Buland <mbuland@penny-arcade.com> | 2022-04-20 11:14:47 -0700 |
commit | d10e6a5ca0905f0ef2836cd98aebfb48e7f1e8a3 (patch) | |
tree | 0235e978cc5ffa94d790a4e26b5cf1e5492cab2b /src/test | |
parent | 819ff3d27012b4ec4a0a21c150c112a4dd28b14d (diff) | |
download | libbu++-d10e6a5ca0905f0ef2836cd98aebfb48e7f1e8a3.tar.gz libbu++-d10e6a5ca0905f0ef2836cd98aebfb48e7f1e8a3.tar.bz2 libbu++-d10e6a5ca0905f0ef2836cd98aebfb48e7f1e8a3.tar.xz libbu++-d10e6a5ca0905f0ef2836cd98aebfb48e7f1e8a3.zip |
ArchiveBase/Archive renamed. More to come.
Diffstat (limited to '')
-rw-r--r-- | src/tests/cache.cpp | 28 | ||||
-rw-r--r-- | src/tests/cachedel.cpp | 28 |
2 files changed, 28 insertions, 28 deletions
diff --git a/src/tests/cache.cpp b/src/tests/cache.cpp index 4751559..3b32daf 100644 --- a/src/tests/cache.cpp +++ b/src/tests/cache.cpp | |||
@@ -5,8 +5,8 @@ | |||
5 | 5 | ||
6 | class Something : public Bu::CacheObject<Bu::Uuid, Something> | 6 | class Something : public Bu::CacheObject<Bu::Uuid, Something> |
7 | { | 7 | { |
8 | friend Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, Something &s ); | 8 | friend Bu::Archive &operator>>( Bu::Archive &ar, Something &s ); |
9 | friend Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const Something &s ); | 9 | friend Bu::Archive &operator<<( Bu::Archive &ar, const Something &s ); |
10 | public: | 10 | public: |
11 | Something() | 11 | Something() |
12 | { | 12 | { |
@@ -47,8 +47,8 @@ private: | |||
47 | 47 | ||
48 | class SubSomethingA : public Something | 48 | class SubSomethingA : public Something |
49 | { | 49 | { |
50 | friend Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, SubSomethingA &s ); | 50 | friend Bu::Archive &operator>>( Bu::Archive &ar, SubSomethingA &s ); |
51 | friend Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const SubSomethingA &s ); | 51 | friend Bu::Archive &operator<<( Bu::Archive &ar, const SubSomethingA &s ); |
52 | public: | 52 | public: |
53 | SubSomethingA() | 53 | SubSomethingA() |
54 | { | 54 | { |
@@ -71,8 +71,8 @@ private: | |||
71 | 71 | ||
72 | class SubSomethingB : public Something | 72 | class SubSomethingB : public Something |
73 | { | 73 | { |
74 | friend Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, SubSomethingB &s ); | 74 | friend Bu::Archive &operator>>( Bu::Archive &ar, SubSomethingB &s ); |
75 | friend Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const SubSomethingB &s ); | 75 | friend Bu::Archive &operator<<( Bu::Archive &ar, const SubSomethingB &s ); |
76 | public: | 76 | public: |
77 | SubSomethingB() | 77 | SubSomethingB() |
78 | { | 78 | { |
@@ -93,32 +93,32 @@ private: | |||
93 | Bu::String sString; | 93 | Bu::String sString; |
94 | }; | 94 | }; |
95 | 95 | ||
96 | Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, Something &s ) | 96 | Bu::Archive &operator>>( Bu::Archive &ar, Something &s ) |
97 | { | 97 | { |
98 | return ar >> s.uId >> s.sName; | 98 | return ar >> s.uId >> s.sName; |
99 | } | 99 | } |
100 | 100 | ||
101 | Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const Something &s ) | 101 | Bu::Archive &operator<<( Bu::Archive &ar, const Something &s ) |
102 | { | 102 | { |
103 | return ar << s.uId << s.sName; | 103 | return ar << s.uId << s.sName; |
104 | } | 104 | } |
105 | 105 | ||
106 | Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, SubSomethingA &s ) | 106 | Bu::Archive &operator>>( Bu::Archive &ar, SubSomethingA &s ) |
107 | { | 107 | { |
108 | return ar >> (Something &)s >> s.iNumber; | 108 | return ar >> (Something &)s >> s.iNumber; |
109 | } | 109 | } |
110 | 110 | ||
111 | Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const SubSomethingA &s ) | 111 | Bu::Archive &operator<<( Bu::Archive &ar, const SubSomethingA &s ) |
112 | { | 112 | { |
113 | return ar << (Something &)s << s.iNumber; | 113 | return ar << (Something &)s << s.iNumber; |
114 | } | 114 | } |
115 | 115 | ||
116 | Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, SubSomethingB &s ) | 116 | Bu::Archive &operator>>( Bu::Archive &ar, SubSomethingB &s ) |
117 | { | 117 | { |
118 | return ar >> (Something &)s >> s.sString; | 118 | return ar >> (Something &)s >> s.sString; |
119 | } | 119 | } |
120 | 120 | ||
121 | Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const SubSomethingB &s ) | 121 | Bu::Archive &operator<<( Bu::Archive &ar, const SubSomethingB &s ) |
122 | { | 122 | { |
123 | return ar << (Something &)s << s.sString; | 123 | return ar << (Something &)s << s.sString; |
124 | } | 124 | } |
@@ -128,7 +128,7 @@ namespace Bu | |||
128 | template<> | 128 | template<> |
129 | void _cacheObjectSave<const Something>( Bu::Stream &s, const Something *pObject ) | 129 | void _cacheObjectSave<const Something>( Bu::Stream &s, const Something *pObject ) |
130 | { | 130 | { |
131 | Bu::Archive ar( s, Bu::Archive::save ); | 131 | Bu::ArchiveBinary ar( s, Bu::ArchiveBinary::save ); |
132 | if( typeid(*pObject) == typeid(SubSomethingA) ) | 132 | if( typeid(*pObject) == typeid(SubSomethingA) ) |
133 | { | 133 | { |
134 | ar << (uint8_t)1 << (SubSomethingA &)*pObject; | 134 | ar << (uint8_t)1 << (SubSomethingA &)*pObject; |
@@ -147,7 +147,7 @@ namespace Bu | |||
147 | template<> | 147 | template<> |
148 | Something *_cacheObjectLoad<Bu::Uuid, Something>( Bu::CacheObject<Bu::Uuid, Something>::Initializer &initObj, const Bu::Uuid &rKey, Bu::Stream &s ) | 148 | Something *_cacheObjectLoad<Bu::Uuid, Something>( Bu::CacheObject<Bu::Uuid, Something>::Initializer &initObj, const Bu::Uuid &rKey, Bu::Stream &s ) |
149 | { | 149 | { |
150 | Bu::Archive ar( s, Bu::Archive::load ); | 150 | Bu::ArchiveBinary ar( s, Bu::ArchiveBinary::load ); |
151 | uint8_t uType; | 151 | uint8_t uType; |
152 | ar >> uType; | 152 | ar >> uType; |
153 | switch( uType ) | 153 | switch( uType ) |
diff --git a/src/tests/cachedel.cpp b/src/tests/cachedel.cpp index 817757c..fd40994 100644 --- a/src/tests/cachedel.cpp +++ b/src/tests/cachedel.cpp | |||
@@ -6,8 +6,8 @@ | |||
6 | 6 | ||
7 | class Something : public Bu::CacheObject<Bu::Uuid, Something> | 7 | class Something : public Bu::CacheObject<Bu::Uuid, Something> |
8 | { | 8 | { |
9 | friend Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, Something &s ); | 9 | friend Bu::Archive &operator>>( Bu::Archive &ar, Something &s ); |
10 | friend Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const Something &s ); | 10 | friend Bu::Archive &operator<<( Bu::Archive &ar, const Something &s ); |
11 | public: | 11 | public: |
12 | Something() | 12 | Something() |
13 | { | 13 | { |
@@ -48,8 +48,8 @@ private: | |||
48 | 48 | ||
49 | class SubSomethingA : public Something | 49 | class SubSomethingA : public Something |
50 | { | 50 | { |
51 | friend Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, SubSomethingA &s ); | 51 | friend Bu::Archive &operator>>( Bu::Archive &ar, SubSomethingA &s ); |
52 | friend Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const SubSomethingA &s ); | 52 | friend Bu::Archive &operator<<( Bu::Archive &ar, const SubSomethingA &s ); |
53 | public: | 53 | public: |
54 | SubSomethingA() | 54 | SubSomethingA() |
55 | { | 55 | { |
@@ -72,8 +72,8 @@ private: | |||
72 | 72 | ||
73 | class SubSomethingB : public Something | 73 | class SubSomethingB : public Something |
74 | { | 74 | { |
75 | friend Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, SubSomethingB &s ); | 75 | friend Bu::Archive &operator>>( Bu::Archive &ar, SubSomethingB &s ); |
76 | friend Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const SubSomethingB &s ); | 76 | friend Bu::Archive &operator<<( Bu::Archive &ar, const SubSomethingB &s ); |
77 | public: | 77 | public: |
78 | SubSomethingB() | 78 | SubSomethingB() |
79 | { | 79 | { |
@@ -94,32 +94,32 @@ private: | |||
94 | Bu::String sString; | 94 | Bu::String sString; |
95 | }; | 95 | }; |
96 | 96 | ||
97 | Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, Something &s ) | 97 | Bu::Archive &operator>>( Bu::Archive &ar, Something &s ) |
98 | { | 98 | { |
99 | return ar >> s.uId >> s.sName; | 99 | return ar >> s.uId >> s.sName; |
100 | } | 100 | } |
101 | 101 | ||
102 | Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const Something &s ) | 102 | Bu::Archive &operator<<( Bu::Archive &ar, const Something &s ) |
103 | { | 103 | { |
104 | return ar << s.uId << s.sName; | 104 | return ar << s.uId << s.sName; |
105 | } | 105 | } |
106 | 106 | ||
107 | Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, SubSomethingA &s ) | 107 | Bu::Archive &operator>>( Bu::Archive &ar, SubSomethingA &s ) |
108 | { | 108 | { |
109 | return ar >> (Something &)s >> s.iNumber; | 109 | return ar >> (Something &)s >> s.iNumber; |
110 | } | 110 | } |
111 | 111 | ||
112 | Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const SubSomethingA &s ) | 112 | Bu::Archive &operator<<( Bu::Archive &ar, const SubSomethingA &s ) |
113 | { | 113 | { |
114 | return ar << (Something &)s << s.iNumber; | 114 | return ar << (Something &)s << s.iNumber; |
115 | } | 115 | } |
116 | 116 | ||
117 | Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, SubSomethingB &s ) | 117 | Bu::Archive &operator>>( Bu::Archive &ar, SubSomethingB &s ) |
118 | { | 118 | { |
119 | return ar >> (Something &)s >> s.sString; | 119 | return ar >> (Something &)s >> s.sString; |
120 | } | 120 | } |
121 | 121 | ||
122 | Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const SubSomethingB &s ) | 122 | Bu::Archive &operator<<( Bu::Archive &ar, const SubSomethingB &s ) |
123 | { | 123 | { |
124 | return ar << (Something &)s << s.sString; | 124 | return ar << (Something &)s << s.sString; |
125 | } | 125 | } |
@@ -129,7 +129,7 @@ namespace Bu | |||
129 | template<> | 129 | template<> |
130 | void _cacheObjectSave<const Something>( Bu::Stream &s, const Something *pObject ) | 130 | void _cacheObjectSave<const Something>( Bu::Stream &s, const Something *pObject ) |
131 | { | 131 | { |
132 | Bu::Archive ar( s, Bu::Archive::save ); | 132 | Bu::ArchiveBinary ar( s, Bu::ArchiveBinary::save ); |
133 | if( typeid(*pObject) == typeid(SubSomethingA) ) | 133 | if( typeid(*pObject) == typeid(SubSomethingA) ) |
134 | { | 134 | { |
135 | ar << (uint8_t)1 << (SubSomethingA &)*pObject; | 135 | ar << (uint8_t)1 << (SubSomethingA &)*pObject; |
@@ -148,7 +148,7 @@ namespace Bu | |||
148 | template<> | 148 | template<> |
149 | Something *_cacheObjectLoad<Bu::Uuid, Something>( Bu::CacheObject<Bu::Uuid, Something>::Initializer &initObj, const Bu::Uuid &rKey, Bu::Stream &s ) | 149 | Something *_cacheObjectLoad<Bu::Uuid, Something>( Bu::CacheObject<Bu::Uuid, Something>::Initializer &initObj, const Bu::Uuid &rKey, Bu::Stream &s ) |
150 | { | 150 | { |
151 | Bu::Archive ar( s, Bu::Archive::load ); | 151 | Bu::ArchiveBinary ar( s, Bu::ArchiveBinary::load ); |
152 | uint8_t uType; | 152 | uint8_t uType; |
153 | ar >> uType; | 153 | ar >> uType; |
154 | switch( uType ) | 154 | switch( uType ) |