Network: Replace some String by std::string
This commit is contained in:
@@ -51,7 +51,7 @@ namespace Nz
|
||||
bool CheckEvents(ENetEvent* event);
|
||||
|
||||
ENetPeer* Connect(const IpAddress& remoteAddress, std::size_t channelCount = 0, UInt32 data = 0);
|
||||
ENetPeer* Connect(const String& hostName, NetProtocol protocol = NetProtocol_Any, const String& service = "http", ResolveError* error = nullptr, std::size_t channelCount = 0, UInt32 data = 0);
|
||||
ENetPeer* Connect(const std::string& hostName, NetProtocol protocol = NetProtocol_Any, const std::string& service = "http", ResolveError* error = nullptr, std::size_t channelCount = 0, UInt32 data = 0);
|
||||
|
||||
inline bool Create(NetProtocol protocol, UInt16 port, std::size_t peerCount, std::size_t channelCount = 0);
|
||||
bool Create(const IpAddress& listenAddress, std::size_t peerCount, std::size_t channelCount = 0);
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Nz
|
||||
|
||||
inline IPv4 ToIPv4() const;
|
||||
inline IPv6 ToIPv6() const;
|
||||
String ToString() const;
|
||||
std::string ToString() const;
|
||||
inline UInt32 ToUInt32() const;
|
||||
|
||||
inline explicit operator bool() const;
|
||||
@@ -55,8 +55,8 @@ namespace Nz
|
||||
IpAddress& operator=(const IpAddress&) = default;
|
||||
IpAddress& operator=(IpAddress&&) noexcept = default;
|
||||
|
||||
static String ResolveAddress(const IpAddress& address, String* service = nullptr, ResolveError* error = nullptr);
|
||||
static std::vector<HostnameInfo> ResolveHostname(NetProtocol procol, const String& hostname, const String& protocol = "http", ResolveError* error = nullptr);
|
||||
static std::string ResolveAddress(const IpAddress& address, std::string* service = nullptr, ResolveError* error = nullptr);
|
||||
static std::vector<HostnameInfo> ResolveHostname(NetProtocol procol, const std::string& hostname, const std::string& protocol = "http", ResolveError* error = nullptr);
|
||||
|
||||
inline friend std::ostream& operator<<(std::ostream& out, const IpAddress& address);
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Nz
|
||||
IpAddress address;
|
||||
NetProtocol protocol;
|
||||
SocketType socketType;
|
||||
String canonicalName;
|
||||
std::string canonicalName;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -199,7 +199,6 @@ namespace Nz
|
||||
* \param out The stream
|
||||
* \param address The address to output
|
||||
*/
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& out, const IpAddress& address)
|
||||
{
|
||||
out << "IpAddress(" << address.ToString() << ')';
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Nz
|
||||
inline void Close();
|
||||
|
||||
bool Connect(const IpAddress& remoteAddress);
|
||||
bool Connect(const String& hostName, NetProtocol protocol = NetProtocol_Any, const String& service = "http", ResolveError* error = nullptr);
|
||||
bool Connect(const std::string& hostName, NetProtocol protocol = NetProtocol_Any, const std::string& service = "http", ResolveError* error = nullptr);
|
||||
inline void Disconnect();
|
||||
|
||||
inline IpAddress GetBoundAddress() const;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <Nazara/Core/Stream.hpp>
|
||||
#include <Nazara/Network/AbstractSocket.hpp>
|
||||
#include <Nazara/Network/IpAddress.hpp>
|
||||
#include <string>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
@@ -28,7 +29,7 @@ namespace Nz
|
||||
~TcpClient() = default;
|
||||
|
||||
SocketState Connect(const IpAddress& remoteAddress);
|
||||
SocketState Connect(const String& hostName, NetProtocol protocol = NetProtocol_Any, const String& service = "http", ResolveError* error = nullptr);
|
||||
SocketState Connect(const std::string& hostName, NetProtocol protocol = NetProtocol_Any, const std::string& service = "http", ResolveError* error = nullptr);
|
||||
inline void Disconnect();
|
||||
|
||||
void EnableLowDelay(bool lowDelay);
|
||||
|
||||
Reference in New Issue
Block a user