Packet wraps data to send / to receive through the network. More...
#include <Packet.hpp>
Public Member Functions | |
Packet () | |
Default constructor. | |
virtual | ~Packet () |
Virtual destructor. | |
void | Append (const void *Data, std::size_t SizeInBytes) |
Append data to the end of the packet. | |
void | Clear () |
Clear the packet data. | |
const char * | GetData () const |
Get a pointer to the data contained in the packet Warning : the returned pointer may be invalid after you append data to the packet. | |
std::size_t | GetDataSize () const |
Get the size of the data contained in the packet. | |
bool | EndOfPacket () const |
Tell if the reading position has reached the end of the packet. | |
operator bool () const | |
Return the validity of packet. | |
Packet & | operator>> (bool &Data) |
Operator >> overloads to extract data from the packet. | |
Packet & | operator>> (Int8 &Data) |
Packet & | operator>> (Uint8 &Data) |
Packet & | operator>> (Int16 &Data) |
Packet & | operator>> (Uint16 &Data) |
Packet & | operator>> (Int32 &Data) |
Packet & | operator>> (Uint32 &Data) |
Packet & | operator>> (float &Data) |
Packet & | operator>> (double &Data) |
Packet & | operator>> (char *Data) |
Packet & | operator>> (std::string &Data) |
Packet & | operator>> (wchar_t *Data) |
Packet & | operator>> (std::wstring &Data) |
Packet & | operator<< (bool Data) |
Operator << overloads to put data into the packet. | |
Packet & | operator<< (Int8 Data) |
Packet & | operator<< (Uint8 Data) |
Packet & | operator<< (Int16 Data) |
Packet & | operator<< (Uint16 Data) |
Packet & | operator<< (Int32 Data) |
Packet & | operator<< (Uint32 Data) |
Packet & | operator<< (float Data) |
Packet & | operator<< (double Data) |
Packet & | operator<< (const char *Data) |
Packet & | operator<< (const std::string &Data) |
Packet & | operator<< (const wchar_t *Data) |
Packet & | operator<< (const std::wstring &Data) |
Friends | |
class | SocketTCP |
class | SocketUDP |
Packet wraps data to send / to receive through the network.
Definition at line 41 of file Packet.hpp.
sf::Packet::Packet | ( | ) |
Default constructor.
|
virtual |
Virtual destructor.
void sf::Packet::Append | ( | const void * | Data, |
std::size_t | SizeInBytes | ||
) |
Append data to the end of the packet.
Data | : Pointer to the bytes to append |
SizeInBytes | : Number of bytes to append |
void sf::Packet::Clear | ( | ) |
Clear the packet data.
bool sf::Packet::EndOfPacket | ( | ) | const |
Tell if the reading position has reached the end of the packet.
const char* sf::Packet::GetData | ( | ) | const |
Get a pointer to the data contained in the packet Warning : the returned pointer may be invalid after you append data to the packet.
std::size_t sf::Packet::GetDataSize | ( | ) | const |
Get the size of the data contained in the packet.
sf::Packet::operator bool | ( | ) | const |
Return the validity of packet.
Packet& sf::Packet::operator<< | ( | bool | Data | ) |
Operator << overloads to put data into the packet.
Packet& sf::Packet::operator>> | ( | bool & | Data | ) |
Operator >> overloads to extract data from the packet.