///< Convert string to address
/**< This member will try to convert the given string into
an IP address. from_string() supports all standard IP
- literal representations as well es hostnames.
+ literal representations as well as hostnames.
\attention This call may block if \a s represents a
hostname which must be looked up via some network
protocol like DNS or NIS
/**< This member returns the address as an integer number in
host byte order. This representation allows simple
network math operations. */
- std::string toString() const;
- ///< get the string representation of this INet4Address
-
////@}
private:
\related INet4Address
*/
std::ostream & operator<<(std::ostream & os, INet4Address const & addr);
+ /** \brief Try to initialize INet4Address instance from a string representation
+ sets std::ios::failbit on the stream if an error occurred
+ \see INet4Address from_string()
+ \related INet4Address
+ */
+ std::istream & operator>>(std::istream & os, INet4Address & addr);
/** \brief CHeck INet4Address against a fixed network prefix
///@{
INet4Network(); ///< Construct empty (0.0.0.0/0) network
- INet4Network(INet4Address address, unsigned prefix_len);
+ INet4Network(INet4Address const & address, unsigned prefix_len);
///< Construct network from given address and prefix length
- explicit INet4Network(std::string s); ///< Construct network from CIDR notation
+ explicit INet4Network(std::string const & s); ///< Construct network from CIDR notation
///@}
///////////////////////////////////////////////////////////////////////////
bool operator==(INet4Network const & other) const;
///< Compare to networks for equality
- bool match(INet4Address addr) const; ///< \c true, if the network includes \a addr
- bool match(INet4Network net) const; ///< \c true, if the network includes \a net
+ bool match(INet4Address const & addr) const; ///< \c true, if the network includes \a addr
+ bool match(INet4Network const & net) const; ///< \c true, if the network includes \a net
/**< The is true, if \a net is sub-network (or the same as)
\c this. */