2 * Copyright 2009, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Bruno Albuquerque, bga@bug-br.org.br
12 #include <Archivable.h>
13 #include <SupportDefs.h>
20 class BNetBuffer
: public BArchivable
{
22 BNetBuffer(size_t size
= 0);
24 virtual ~BNetBuffer();
26 BNetBuffer(const BNetBuffer
& buffer
);
27 BNetBuffer(BMessage
* archive
);
29 BNetBuffer
& operator=(const BNetBuffer
& buffer
);
31 virtual status_t
Archive(BMessage
* into
, bool deep
= true) const;
32 static BArchivable
* Instantiate(BMessage
* archive
);
36 status_t
AppendInt8(int8 data
);
37 status_t
AppendUint8(uint8 data
);
38 status_t
AppendInt16(int16 data
);
39 status_t
AppendUint16(uint16 data
);
40 status_t
AppendInt32(int32 data
);
41 status_t
AppendUint32(uint32 data
);
42 status_t
AppendFloat(float data
);
43 status_t
AppendDouble(double data
);
44 status_t
AppendString(const char* data
);
45 status_t
AppendData(const void* data
, size_t size
);
46 status_t
AppendMessage(const BMessage
& data
);
47 status_t
AppendInt64(int64 data
);
48 status_t
AppendUint64(uint64 data
);
50 status_t
RemoveInt8(int8
& data
);
51 status_t
RemoveUint8(uint8
& data
);
52 status_t
RemoveInt16(int16
& data
);
53 status_t
RemoveUint16(uint16
& data
);
54 status_t
RemoveInt32(int32
& data
);
55 status_t
RemoveUint32(uint32
& data
);
56 status_t
RemoveFloat(float& data
);
57 status_t
RemoveDouble(double& data
);
58 status_t
RemoveString(char* data
, size_t size
);
59 status_t
RemoveData(void* data
, size_t size
);
60 status_t
RemoveMessage(BMessage
& data
);
61 status_t
RemoveInt64(int64
& data
);
62 status_t
RemoveUint64(uint64
& data
);
64 unsigned char* Data() const;
66 size_t BytesRemaining() const;
68 inline DynamicBuffer
* GetImpl() const;
74 virtual void _ReservedBNetBufferFBCCruft1();
75 virtual void _ReservedBNetBufferFBCCruft2();
76 virtual void _ReservedBNetBufferFBCCruft3();
77 virtual void _ReservedBNetBufferFBCCruft4();
78 virtual void _ReservedBNetBufferFBCCruft5();
79 virtual void _ReservedBNetBufferFBCCruft6();
82 int32 __ReservedBNetBufferFBCCruftData
[8];
88 BNetBuffer::GetImpl() const
93 #endif // _NET_BUFFER_H