From ca7c1d1690c5ec767d7f13f6897d25ece1e3167d Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Sat, 13 Mar 2010 10:20:13 +0000 Subject: [PATCH] Applied the last IpAddress modifications to CSFML git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1457 4e206d99-4929-0410-ac5d-dfc041789085 --- CSFML/include/SFML/Network/IpAddress.h | 18 ++++++++---------- CSFML/src/SFML/Network/IpAddress.cpp | 17 ++++++++--------- CSFML/src/SFML/Network/csfml-network-d.def | 2 +- CSFML/src/SFML/Network/csfml-network.def | 2 +- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/CSFML/include/SFML/Network/IpAddress.h b/CSFML/include/SFML/Network/IpAddress.h index e879b414..fc2f15d5 100644 --- a/CSFML/include/SFML/Network/IpAddress.h +++ b/CSFML/include/SFML/Network/IpAddress.h @@ -71,16 +71,6 @@ CSFML_API sfIpAddress sfIpAddress_FromBytes(sfUint8 byte0, sfUint8 byte1, sfUint //////////////////////////////////////////////////////////// CSFML_API sfIpAddress sfIpAddress_FromInteger(sfUint32 address); -//////////////////////////////////////////////////////////// -/// Tell if an address is a valid one -/// -/// \param address : Address to check -/// -/// \return sfTrue if address has a valid syntax -/// -//////////////////////////////////////////////////////////// -CSFML_API sfBool sfIpAddress_IsValid(sfIpAddress address); - //////////////////////////////////////////////////////////// /// Get a string representation of an address /// @@ -129,5 +119,13 @@ CSFML_API sfIpAddress sfIpAddress_GetPublicAddress(float timeout); //////////////////////////////////////////////////////////// CSFML_API sfIpAddress sfIpAddress_LocalHost(); +//////////////////////////////////////////////////////////// +/// Get the empty/invalid address +/// +/// \return Empty object that represents invalid addresses +/// +//////////////////////////////////////////////////////////// +CSFML_API sfIpAddress sfIpAddress_None(); + #endif // SFML_IPADDRESS_H diff --git a/CSFML/src/SFML/Network/IpAddress.cpp b/CSFML/src/SFML/Network/IpAddress.cpp index 1c20e4ee..cd32a83e 100644 --- a/CSFML/src/SFML/Network/IpAddress.cpp +++ b/CSFML/src/SFML/Network/IpAddress.cpp @@ -80,15 +80,6 @@ sfIpAddress sfIpAddress_FromInteger(sfUint32 address) } -//////////////////////////////////////////////////////////// -/// Tell if an address is a valid one -//////////////////////////////////////////////////////////// -sfBool sfIpAddress_IsValid(sfIpAddress address) -{ - return ToSFMLAddress(address).IsValid() ? sfTrue : sfFalse; -} - - //////////////////////////////////////////////////////////// /// Get a string representation of an address //////////////////////////////////////////////////////////// @@ -136,3 +127,11 @@ sfIpAddress sfIpAddress_LocalHost() { return FromSFMLAddress(sf::IpAddress::LocalHost); } + +//////////////////////////////////////////////////////////// +/// Get the empty/invalid address +//////////////////////////////////////////////////////////// +sfIpAddress sfIpAddress_None() +{ + return FromSFMLAddress(sf::IpAddress::None); +} diff --git a/CSFML/src/SFML/Network/csfml-network-d.def b/CSFML/src/SFML/Network/csfml-network-d.def index c5c92905..a0e5e2f5 100644 --- a/CSFML/src/SFML/Network/csfml-network-d.def +++ b/CSFML/src/SFML/Network/csfml-network-d.def @@ -52,12 +52,12 @@ EXPORTS sfIpAddress_FromString sfIpAddress_FromBytes sfIpAddress_FromInteger - sfIpAddress_IsValid sfIpAddress_ToString sfIpAddress_ToInteger sfIpAddress_GetLocalAddress sfIpAddress_GetPublicAddress sfIpAddress_LocalHost + sfIpAddress_None sfSocketTCP_Create sfSocketTCP_Destroy sfSocketTCP_SetBlocking diff --git a/CSFML/src/SFML/Network/csfml-network.def b/CSFML/src/SFML/Network/csfml-network.def index e33b2f63..b0bf894d 100644 --- a/CSFML/src/SFML/Network/csfml-network.def +++ b/CSFML/src/SFML/Network/csfml-network.def @@ -52,12 +52,12 @@ EXPORTS sfIpAddress_FromString sfIpAddress_FromBytes sfIpAddress_FromInteger - sfIpAddress_IsValid sfIpAddress_ToString sfIpAddress_ToInteger sfIpAddress_GetLocalAddress sfIpAddress_GetPublicAddress sfIpAddress_LocalHost + sfIpAddress_None sfSocketTCP_Create sfSocketTCP_Copy sfSocketTCP_Destroy