BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
3a09c3d
Branches
Tags
master
Blinker
src
linux
Udp4Addr.h
implemented UDP v4 address class
Stefan Schuermans
commited
3a09c3d
at 2011-11-08 19:52:05
Udp4Addr.h
Blame
History
Raw
/* Blinker Copyright 2011 Stefan Schuermans <stefan@blinkenarea.org> Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html a blinkenarea.org project */ #ifndef UDP4ADDR_H #define UDP4ADDR_H #include <netinet/in.h> #include <string> #include <sys/socket.h> #include <sys/types.h> #include "Addr.h" namespace Blinker { /// UDP v4 address class Udp4Addr: public Addr { public: /// constructor Udp4Addr(); /// virtual destructor virtual ~Udp4Addr(); public: /// return address family virtual int getFamily() const; /** * @brief parse from string format * @param[in] str string format * @return if parsing was successful */ virtual bool fromStr(const std::string &str); /** * @brief convert to string format * @return string format */ virtual std::string toStr() const; /** * @brief set to sockaddr * @parma[in] addr sockaddr structure to use * @return if using sockaddr was successful */ virtual bool fromSockaddr(const struct sockaddr &addr); /** * @brief convert to sockaddr * @return sockaddr structure */ virtual const struct sockaddr & toSockaddr() const; protected: struct sockaddr_in m_addr; }; // class Udp4Addr } // namespace Blinker #endif // #ifndef UDP4ADDR_H