Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
NetworkAddress.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SF_NETWORKADDRESS_H
7#define SF_NETWORKADDRESS_H
8
9#include "Define.h"
10#include <string>
11
12namespace Skyfire::Net
13{
14 bool IsIPv4Address(std::string const& host);
15 uint32 ToIPv4NetworkOrder(std::string const& host);
16
17 class Address
18 {
19 public:
20 Address();
21 Address(std::string const& host, uint16 port = 0);
22
23 std::string const& GetHost() const { return _host; }
24 uint16 GetPort() const { return _port; }
25 void SetPort(uint16 port) { _port = port; }
26
27 bool IsLoopback() const;
29
30 private:
31 std::string _host;
33 };
34}
35
36#endif
std::uint32_t uint32
Definition Define.h:77
std::uint16_t uint16
Definition Define.h:78
uint32 ToIPv4NetworkOrder() const
uint16 GetPort() const
void SetPort(uint16 port)
std::string const & GetHost() const
bool IsIPv4Address(std::string const &host)
uint32 ToIPv4NetworkOrder(std::string const &host)