diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-11-25 23:38:14 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-11-25 23:38:14 +0000 |
commit | 27e0164234c916adaf0ce78e29dffe565302ef53 (patch) | |
tree | 9153d33a0fcd67c38daba80a4f6c406a8701cec4 /src/serializer.cpp | |
parent | 2828a0bb77e2cf1bc6fbd38c3bca5cfaddb23b80 (diff) | |
download | libbu++-27e0164234c916adaf0ce78e29dffe565302ef53.tar.gz libbu++-27e0164234c916adaf0ce78e29dffe565302ef53.tar.bz2 libbu++-27e0164234c916adaf0ce78e29dffe565302ef53.tar.xz libbu++-27e0164234c916adaf0ce78e29dffe565302ef53.zip |
I think this is a better serializer model.
Diffstat (limited to 'src/serializer.cpp')
-rw-r--r-- | src/serializer.cpp | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/src/serializer.cpp b/src/serializer.cpp index 0afaf4b..587f613 100644 --- a/src/serializer.cpp +++ b/src/serializer.cpp | |||
@@ -14,6 +14,127 @@ bool Serializer::isLoading() | |||
14 | { | 14 | { |
15 | return bLoading; | 15 | return bLoading; |
16 | } | 16 | } |
17 | Serializer &Serializer::operator<<(bool p) | ||
18 | { | ||
19 | write( &p, sizeof(p) ); | ||
20 | return *this; | ||
21 | } | ||
22 | Serializer &Serializer::operator<<(int8_t p) | ||
23 | { | ||
24 | write( &p, sizeof(p) ); | ||
25 | return *this; | ||
26 | } | ||
27 | Serializer &Serializer::operator<<(int16_t p) | ||
28 | { | ||
29 | write( &p, sizeof(p) ); | ||
30 | return *this; | ||
31 | } | ||
32 | Serializer &Serializer::operator<<(int32_t p) | ||
33 | { | ||
34 | write( &p, sizeof(p) ); | ||
35 | return *this; | ||
36 | } | ||
37 | Serializer &Serializer::operator<<(int64_t p) | ||
38 | { | ||
39 | write( &p, sizeof(p) ); | ||
40 | return *this; | ||
41 | } | ||
42 | Serializer &Serializer::operator<<(uint8_t p) | ||
43 | { | ||
44 | write( &p, sizeof(p) ); | ||
45 | return *this; | ||
46 | } | ||
47 | Serializer &Serializer::operator<<(uint16_t p) | ||
48 | { | ||
49 | write( &p, sizeof(p) ); | ||
50 | return *this; | ||
51 | } | ||
52 | Serializer &Serializer::operator<<(uint32_t p) | ||
53 | { | ||
54 | write( &p, sizeof(p) ); | ||
55 | return *this; | ||
56 | } | ||
57 | Serializer &Serializer::operator<<(uint64_t p) | ||
58 | { | ||
59 | write( &p, sizeof(p) ); | ||
60 | return *this; | ||
61 | } | ||
62 | Serializer &Serializer::operator<<(float p) | ||
63 | { | ||
64 | write( &p, sizeof(p) ); | ||
65 | return *this; | ||
66 | } | ||
67 | Serializer &Serializer::operator<<(double p) | ||
68 | { | ||
69 | write( &p, sizeof(p) ); | ||
70 | return *this; | ||
71 | } | ||
72 | Serializer &Serializer::operator<<(long double p) | ||
73 | { | ||
74 | write( &p, sizeof(p) ); | ||
75 | return *this; | ||
76 | } | ||
77 | |||
78 | Serializer &Serializer::operator>>(bool &p) | ||
79 | { | ||
80 | read( &p, sizeof(p) ); | ||
81 | return *this; | ||
82 | } | ||
83 | Serializer &Serializer::operator>>(int8_t &p) | ||
84 | { | ||
85 | read( &p, sizeof(p) ); | ||
86 | return *this; | ||
87 | } | ||
88 | Serializer &Serializer::operator>>(int16_t &p) | ||
89 | { | ||
90 | read( &p, sizeof(p) ); | ||
91 | return *this; | ||
92 | } | ||
93 | Serializer &Serializer::operator>>(int32_t &p) | ||
94 | { | ||
95 | read( &p, sizeof(p) ); | ||
96 | return *this; | ||
97 | } | ||
98 | Serializer &Serializer::operator>>(int64_t &p) | ||
99 | { | ||
100 | read( &p, sizeof(p) ); | ||
101 | return *this; | ||
102 | } | ||
103 | Serializer &Serializer::operator>>(uint8_t &p) | ||
104 | { | ||
105 | read( &p, sizeof(p) ); | ||
106 | return *this; | ||
107 | } | ||
108 | Serializer &Serializer::operator>>(uint16_t &p) | ||
109 | { | ||
110 | read( &p, sizeof(p) ); | ||
111 | return *this; | ||
112 | } | ||
113 | Serializer &Serializer::operator>>(uint32_t &p) | ||
114 | { | ||
115 | read( &p, sizeof(p) ); | ||
116 | return *this; | ||
117 | } | ||
118 | Serializer &Serializer::operator>>(uint64_t &p) | ||
119 | { | ||
120 | read( &p, sizeof(p) ); | ||
121 | return *this; | ||
122 | } | ||
123 | Serializer &Serializer::operator>>(float &p) | ||
124 | { | ||
125 | read( &p, sizeof(p) ); | ||
126 | return *this; | ||
127 | } | ||
128 | Serializer &Serializer::operator>>(double &p) | ||
129 | { | ||
130 | read( &p, sizeof(p) ); | ||
131 | return *this; | ||
132 | } | ||
133 | Serializer &Serializer::operator>>(long double &p) | ||
134 | { | ||
135 | read( &p, sizeof(p) ); | ||
136 | return *this; | ||
137 | } | ||
17 | 138 | ||
18 | /*Serializer::Serializer &operator&(bool &p) | 139 | /*Serializer::Serializer &operator&(bool &p) |
19 | { | 140 | { |