25 #ifndef SFML_PACKET_HPP
26 #define SFML_PACKET_HPP
31 #include <SFML/Config.hpp>
64 void Append(
const void* Data, std::size_t SizeInBytes);
80 const char* GetData()
const;
88 std::size_t GetDataSize()
const;
96 bool EndOfPacket()
const;
104 operator bool()
const;
110 Packet& operator >>(
bool& Data);
111 Packet& operator >>(Int8& Data);
112 Packet& operator >>(Uint8& Data);
113 Packet& operator >>(Int16& Data);
114 Packet& operator >>(Uint16& Data);
115 Packet& operator >>(Int32& Data);
116 Packet& operator >>(Uint32& Data);
117 Packet& operator >>(
float& Data);
118 Packet& operator >>(
double& Data);
119 Packet& operator >>(
char* Data);
120 Packet& operator >>(std::string& Data);
121 Packet& operator >>(
wchar_t* Data);
122 Packet& operator >>(std::wstring& Data);
128 Packet& operator <<(
bool Data);
129 Packet& operator <<(Int8 Data);
130 Packet& operator <<(Uint8 Data);
131 Packet& operator <<(Int16 Data);
132 Packet& operator <<(Uint16 Data);
133 Packet& operator <<(Int32 Data);
134 Packet& operator <<(Uint32 Data);
135 Packet& operator <<(
float Data);
136 Packet& operator <<(
double Data);
137 Packet& operator <<(
const char* Data);
138 Packet& operator <<(
const std::string& Data);
139 Packet& operator <<(
const wchar_t* Data);
140 Packet& operator <<(
const std::wstring& Data);
155 bool CheckSize(std::size_t Size);
165 virtual const char* OnSend(std::size_t& DataSize);
174 virtual void OnReceive(
const char* Data, std::size_t DataSize);
179 std::vector<char> myData;
180 std::size_t myReadPos;
187 #endif // SFML_PACKET_HPP