alternative Standard Libary  0.29.8
std::net::ip_address4 Klassenreferenz

#include <address.hpp>

+ Klassendiagramm für std::net::ip_address4:
+ Zusammengehörigkeiten von std::net::ip_address4:

Öffentliche Methoden

 ip_address4 ()
 
 ip_address4 (int address)
 
 ip_address4 (const ip_address4 &v)
 
 ip_address4 (unsigned short addr[4])
 
void getaddress (unsigned short b[4])
 
long get ()
 
void set (long value)
 
ip_address4operator= (const ip_address4 &v)
 
std::string to_string ()
 
virtual AddrFamily getFamily ()
 

Öffentliche, statische Methoden

static ip_address4 parse (std::string ip)
 

Statische öffentliche Attribute

static const ip_address4 Any = ip_address4(0x0000000000000000)
 
static const ip_address4 Loop = ip_address4(0x000000000100007F)
 
static const ip_address4 BroadCast = ip_address4(0x00000000FFFFFFFF)
 

Geschützte Attribute

AddrFamily m_addr
 

Ausführliche Beschreibung

Beschreibung der Konstruktoren und Destruktoren

◆ ip_address4() [1/4]

std::net::ip_address4::ip_address4 ( )
inline

◆ ip_address4() [2/4]

std::net::ip_address4::ip_address4 ( int  address)
40  m_address = (long)addr & 0x00000000FFFFFFFF;
41  }
ip_address_base()
Definition: address.hpp:43

◆ ip_address4() [3/4]

std::net::ip_address4::ip_address4 ( const ip_address4 v)
47  : ip_address_base(v.getFamily()) {
48  m_address = v.m_address;
49  }
ip_address_base()
Definition: address.hpp:43

◆ ip_address4() [4/4]

std::net::ip_address4::ip_address4 ( unsigned short  addr[4])
explicit

Dokumentation der Elementfunktionen

◆ get()

long std::net::ip_address4::get ( )
61  {
62  return m_address;
63  }

◆ getaddress()

void std::net::ip_address4::getaddress ( unsigned short  b[4])
50  {
51  b[0] = (unsigned short)(m_address);
52  b[1] = (unsigned short)(m_address >> 8);
53  b[2] = (unsigned short)(m_address >> 16);
54  b[3] = (unsigned short)(m_address >> 24);
55  }

◆ getFamily()

virtual AddrFamily std::net::ip_address_base::getFamily ( )
inlinevirtualinherited
46  {
47  return m_addr;
48  }
AddrFamily m_addr
Definition: address.hpp:51

◆ operator=()

ip_address4 & std::net::ip_address4::operator= ( const ip_address4 v)
64  {
65  m_address = v.m_address; return *this;
66  }

◆ parse()

ip_address4 std::net::ip_address4::parse ( std::string  ip)
static
78  {
79  const char* s_ip = _ip.c_str();
80  unsigned int ip = 0;
81  unsigned char * c_ip = (unsigned char *)&ip;
82  sscanf(s_ip, "%hhu.%hhu.%hhu.%hhu", &c_ip[3], &c_ip[2], &c_ip[1], &c_ip[0]);
83 
84  return ip_address4(ip);
85  }
ip_address4()
Definition: address.hpp:60

◆ set()

void std::net::ip_address4::set ( long  value)
57  {
58  if(!(value < 0 || value > 0x00000000FFFFFFFF))
59  m_address = value;
60  }

◆ to_string()

std::string std::net::ip_address4::to_string ( )
67  {
68  std::string dest ;
69  dest = std::frmstring("%d.%d.%d.%d",
70  (m_address >> 24) & 0xFF,
71  (m_address >> 16) & 0xFF,
72  (m_address >> 8) & 0xFF,
73  (m_address ) & 0xFF);
74 
75  return dest;
76  }
size_t frmstring(basic_string< E, TAllocator, TStorage > &dest, const char *format, va_list arg)
Definition: string.hpp:99

Dokumentation der Datenelemente

◆ Any

const ip_address4 std::net::ip_address4::Any = ip_address4(0x0000000000000000)
static

◆ BroadCast

const ip_address4 std::net::ip_address4::BroadCast = ip_address4(0x00000000FFFFFFFF)
static

◆ Loop

const ip_address4 std::net::ip_address4::Loop = ip_address4(0x000000000100007F)
static

◆ m_addr

AddrFamily std::net::ip_address_base::m_addr
protectedinherited

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Dateien: