15 |
|
|
16 |
|
class Binary |
17 |
|
{ |
18 |
< |
private: |
18 |
> |
protected: |
19 |
|
ext::Vector<byte_t> bytes; |
20 |
+ |
Binary(size_t size, byte_t value) : bytes(size, value) {} |
21 |
|
public: |
22 |
|
Binary() : bytes(size_t(1), 0) {} |
23 |
|
Binary(const ext::String& string, bool signed_); |
24 |
|
template <typename Type> Binary(const Type& type); |
25 |
|
template <typename Type> Type convert(bool signed_); |
26 |
< |
operator ext::String() const; |
26 |
> |
virtual operator ext::String() const; |
27 |
|
}; |
28 |
|
|
29 |
|
template <typename Type> |
31 |
|
{ |
32 |
|
byte_t* type_(reinterpret_cast<byte_t*>(const_cast<Type*>(&type))); |
33 |
|
|
34 |
< |
_mforeach (ext::Vector<byte_t>, byte, bytes) *byte = *type_++; |
34 |
> |
_foreach (ext::Vector<byte_t>, byte, bytes) *byte = *type_++; |
35 |
|
} |
36 |
|
|
37 |
|
template <typename Type> |