Replace tabs with spaces in more files.
--HG-- branch : trunk
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
** \file Ipv4Address.h
|
||||
** \date 2006-09-21
|
||||
** \author [email protected]
|
||||
** \file Ipv4Address.h
|
||||
** \date 2006-09-21
|
||||
** \author [email protected]
|
||||
**/
|
||||
/*
|
||||
Copyright (C) 2007 Anders Hedstrom
|
||||
@@ -33,59 +33,59 @@ namespace SOCKETS_NAMESPACE {
|
||||
|
||||
|
||||
/* Ipv4 address implementation.
|
||||
\ingroup basic */
|
||||
\ingroup basic */
|
||||
class Ipv4Address : public SocketAddress
|
||||
{
|
||||
public:
|
||||
/** Create empty Ipv4 address structure.
|
||||
\param port Port number */
|
||||
Ipv4Address(port_t port = 0);
|
||||
/** Create Ipv4 address structure.
|
||||
\param a Socket address in network byte order (as returned by Utility::u2ip)
|
||||
\param port Port number in host byte order */
|
||||
Ipv4Address(ipaddr_t a,port_t port);
|
||||
/** Create Ipv4 address structure.
|
||||
\param a Socket address in network byte order
|
||||
\param port Port number in host byte order */
|
||||
Ipv4Address(struct in_addr& a,port_t port);
|
||||
/** Create Ipv4 address structure.
|
||||
\param host Hostname to be resolved
|
||||
\param port Port number in host byte order */
|
||||
Ipv4Address(const std::string& host,port_t port);
|
||||
Ipv4Address(struct sockaddr_in&);
|
||||
~Ipv4Address();
|
||||
/** Create empty Ipv4 address structure.
|
||||
\param port Port number */
|
||||
Ipv4Address(port_t port = 0);
|
||||
/** Create Ipv4 address structure.
|
||||
\param a Socket address in network byte order (as returned by Utility::u2ip)
|
||||
\param port Port number in host byte order */
|
||||
Ipv4Address(ipaddr_t a,port_t port);
|
||||
/** Create Ipv4 address structure.
|
||||
\param a Socket address in network byte order
|
||||
\param port Port number in host byte order */
|
||||
Ipv4Address(struct in_addr& a,port_t port);
|
||||
/** Create Ipv4 address structure.
|
||||
\param host Hostname to be resolved
|
||||
\param port Port number in host byte order */
|
||||
Ipv4Address(const std::string& host,port_t port);
|
||||
Ipv4Address(struct sockaddr_in&);
|
||||
~Ipv4Address();
|
||||
|
||||
// SocketAddress implementation
|
||||
// SocketAddress implementation
|
||||
|
||||
operator struct sockaddr *();
|
||||
operator socklen_t();
|
||||
bool operator==(SocketAddress&);
|
||||
operator struct sockaddr *();
|
||||
operator socklen_t();
|
||||
bool operator==(SocketAddress&);
|
||||
|
||||
void SetPort(port_t port);
|
||||
port_t GetPort();
|
||||
void SetPort(port_t port);
|
||||
port_t GetPort();
|
||||
|
||||
void SetAddress(struct sockaddr *sa);
|
||||
int GetFamily();
|
||||
void SetAddress(struct sockaddr *sa);
|
||||
int GetFamily();
|
||||
|
||||
bool IsValid();
|
||||
std::auto_ptr<SocketAddress> GetCopy();
|
||||
bool IsValid();
|
||||
std::auto_ptr<SocketAddress> GetCopy();
|
||||
|
||||
/** Convert address struct to text. */
|
||||
std::string Convert(bool include_port = false);
|
||||
std::string Reverse();
|
||||
/** Convert address struct to text. */
|
||||
std::string Convert(bool include_port = false);
|
||||
std::string Reverse();
|
||||
|
||||
/** Resolve hostname. */
|
||||
static bool Resolve(const std::string& hostname,struct in_addr& a);
|
||||
/** Reverse resolve (IP to hostname). */
|
||||
static bool Reverse(struct in_addr& a,std::string& name);
|
||||
/** Convert address struct to text. */
|
||||
static std::string Convert(struct in_addr& a);
|
||||
/** Resolve hostname. */
|
||||
static bool Resolve(const std::string& hostname,struct in_addr& a);
|
||||
/** Reverse resolve (IP to hostname). */
|
||||
static bool Reverse(struct in_addr& a,std::string& name);
|
||||
/** Convert address struct to text. */
|
||||
static std::string Convert(struct in_addr& a);
|
||||
|
||||
private:
|
||||
Ipv4Address(const Ipv4Address& ) {} // copy constructor
|
||||
Ipv4Address& operator=(const Ipv4Address& ) { return *this; } // assignment operator
|
||||
struct sockaddr_in m_addr;
|
||||
bool m_valid;
|
||||
Ipv4Address(const Ipv4Address& ) {} // copy constructor
|
||||
Ipv4Address& operator=(const Ipv4Address& ) { return *this; } // assignment operator
|
||||
struct sockaddr_in m_addr;
|
||||
bool m_valid;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user