libDwm-0.9.45
Dwm::MacAddress Class Reference

Encapsulates a 6-byte MAC address. More...

#include <DwmMacAddress.hh>

Public Member Functions

 MacAddress ()
 Constructor. Sets the address to 00:00:00:00:00:00.
 
 MacAddress (const std::string &s)
 Construct from a string of the form xx:xx:xx:xx:xx:xx.
 
 MacAddress (const MacAddress &addr)
 Copy constructor.
 
MacAddressoperator= (const MacAddress &addr)
 operator =
 
 operator std::string () const
 Returns a string representation of the MAC address.
 
bool operator== (const MacAddress &addr) const
 operator ==
 
bool operator< (const MacAddress &addr) const
 operator <
 
std::istream & Read (std::istream &is)
 Reads the MAC address from an istream. Returns the istream.
 
std::ostream & Write (std::ostream &os) const
 Writes the MAC address to an ostream. Returns the ostream.
 
ssize_t Read (int fd)
 Reads the MAC address from a file descriptor.
 
ssize_t Write (int fd) const
 Writes the MAC address to a file descriptor.
 
size_t Read (FILE *f)
 Reads the MAC address from a FILE.
 
size_t Write (FILE *f) const
 Writes the MAC address to a FILE.
 
int Read (gzFile gzf)
 Reads the MAC address from a gzFile.
 
int Write (gzFile gzf) const
 Writes the MAC address to a gzFile.
 
int BZRead (BZFILE *bzf)
 Reads the MAC address from a BZFILE.
 
int BZWrite (BZFILE *bzf) const
 Writes the MAC address to a BZFILE.
 
uint64_t StreamedLength () const
 Returns the number of bytes that should be written if we call one of the Write() members.
 

Protected Attributes

uint8_t _addr [6]
 

Friends

std::ostream & operator<< (std::ostream &os, const MacAddress &addr)
 Prints to an ostream in 'xx:xx:xx:xx:xx:xx' format.
 
std::istream & operator>> (std::istream &is, MacAddress &addr)
 Reads from an istream in 'xx:xx:xx:xx:xx:xx' format.
 

Detailed Description

Encapsulates a 6-byte MAC address.

Member Function Documentation

◆ BZRead()

int Dwm::MacAddress::BZRead ( BZFILE * bzf)

Reads the MAC address from a BZFILE.

Returns the number of bytes read on success (should be 6), -1 on failure.

◆ BZWrite()

int Dwm::MacAddress::BZWrite ( BZFILE * bzf) const

Writes the MAC address to a BZFILE.

Returns the number of bytes written on success (should be 6), -1 on failure.

◆ Read() [1/3]

size_t Dwm::MacAddress::Read ( FILE * f)

Reads the MAC address from a FILE.

Returns 1 on success, 0 on failure.

◆ Read() [2/3]

int Dwm::MacAddress::Read ( gzFile gzf)

Reads the MAC address from a gzFile.

Returns the number of bytes read on success (should be 6), -1 on failure.

◆ Read() [3/3]

ssize_t Dwm::MacAddress::Read ( int fd)

Reads the MAC address from a file descriptor.

Returns the number of bytes read on success (should be 6), -1 on failure.

◆ StreamedLength()

uint64_t Dwm::MacAddress::StreamedLength ( ) const

Returns the number of bytes that should be written if we call one of the Write() members.

Should always return 6.

◆ Write() [1/3]

size_t Dwm::MacAddress::Write ( FILE * f) const

Writes the MAC address to a FILE.

Returns 1 on success, 0 on failure.

◆ Write() [2/3]

int Dwm::MacAddress::Write ( gzFile gzf) const

Writes the MAC address to a gzFile.

Returns the number of bytes written on success (should be 6), -1 on failure.

◆ Write() [3/3]

ssize_t Dwm::MacAddress::Write ( int fd) const

Writes the MAC address to a file descriptor.

Returns the number of bytes written on success (should be 6), -1 on failure.


The documentation for this class was generated from the following file: