Replaced char* arguments with void* for raw data
This commit is contained in:
parent
69f387de22
commit
8d0da1d9d6
8 changed files with 37 additions and 37 deletions
|
@ -99,7 +99,7 @@ public :
|
|||
/// \see getDataSize
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* getData() const;
|
||||
const void* getData() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the size of the data contained in the packet
|
||||
|
@ -250,7 +250,7 @@ private :
|
|||
/// \see onReceive
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual const char* onSend(std::size_t& size);
|
||||
virtual const void* onSend(std::size_t& size);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Called after the packet is received over the network
|
||||
|
@ -269,7 +269,7 @@ private :
|
|||
/// \see onSend
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual void onReceive(const char* data, std::size_t size);
|
||||
virtual void onReceive(const void* data, std::size_t size);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Member data
|
||||
|
@ -377,18 +377,18 @@ private :
|
|||
/// \code
|
||||
/// class ZipPacket : public sf::Packet
|
||||
/// {
|
||||
/// virtual const char* onSend(std::size_t& size)
|
||||
/// virtual const void* onSend(std::size_t& size)
|
||||
/// {
|
||||
/// const char* srcData = getData();
|
||||
/// const void* srcData = getData();
|
||||
/// std::size_t srcSize = getDataSize();
|
||||
///
|
||||
/// return MySuperZipFunction(srcData, srcSize, &size);
|
||||
/// }
|
||||
///
|
||||
/// virtual void onReceive(const char* data, std::size_t size)
|
||||
/// virtual void onReceive(const void* data, std::size_t size)
|
||||
/// {
|
||||
/// std::size_t dstSize;
|
||||
/// const char* dstData = MySuperUnzipFunction(data, size, &dstSize);
|
||||
/// const void* dstData = MySuperUnzipFunction(data, size, &dstSize);
|
||||
///
|
||||
/// append(dstData, dstSize);
|
||||
/// }
|
||||
|
|
|
@ -134,7 +134,7 @@ public :
|
|||
/// \see receive
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Status send(const char* data, std::size_t size);
|
||||
Status send(const void* data, std::size_t size);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Receive raw data from the remote peer
|
||||
|
@ -152,7 +152,7 @@ public :
|
|||
/// \see send
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Status receive(char* data, std::size_t size, std::size_t& received);
|
||||
Status receive(void* data, std::size_t size, std::size_t& received);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Send a formatted packet of data to the remote peer
|
||||
|
|
|
@ -120,7 +120,7 @@ public :
|
|||
/// \see receive
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Status send(const char* data, std::size_t size, const IpAddress& remoteAddress, unsigned short remotePort);
|
||||
Status send(const void* data, std::size_t size, const IpAddress& remoteAddress, unsigned short remotePort);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Receive raw data from a remote peer
|
||||
|
@ -143,7 +143,7 @@ public :
|
|||
/// \see send
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Status receive(char* data, std::size_t size, std::size_t& received, IpAddress& remoteAddress, unsigned short& remotePort);
|
||||
Status receive(void* data, std::size_t size, std::size_t& received, IpAddress& remoteAddress, unsigned short& remotePort);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Send a formatted packet of data to a remote peer
|
||||
|
|
|
@ -56,7 +56,7 @@ public :
|
|||
/// \return The number of bytes actually read
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual Int64 read(char* data, Int64 size) = 0;
|
||||
virtual Int64 read(void* data, Int64 size) = 0;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change the current reading position
|
||||
|
@ -117,7 +117,7 @@ public :
|
|||
///
|
||||
/// bool open(std::string filename);
|
||||
///
|
||||
/// Int64 read(char* data, Int64 size);
|
||||
/// Int64 read(void* data, Int64 size);
|
||||
///
|
||||
/// Int64 seek(Int64 position);
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue