//#include "UNAddressing.ih"
// Custom includes
-#include <stdio.h>
-#include <boost/operators.hpp>
+
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
prefix_ senf::UNSocketAddress::UNSocketAddress()
{}
-prefix_ senf::UNSocketAddress::UNSocketAddress(std::string p)
+prefix_ senf::UNSocketAddress::UNSocketAddress(std::string const & path)
{
clear();
- ::strncpy(addr_.sun_path, p.c_str(), sizeof(addr_.sun_path));
+ ::strncpy(addr_.sun_path, path.c_str(), sizeof(addr_.sun_path));
addr_.sun_path[sizeof(addr_.sun_path)-1] = 0;
}
-prefix_ senf::UNSocketAddress fromString(std::string s)
-{
- return senf::UNSocketAddress::UNSocketAddress(s);
-}
-
prefix_ bool senf::UNSocketAddress::operator==(UNSocketAddress const & other)
const
{
}
prefix_ std::string senf::UNSocketAddress::path()
- const
+ const
{
return std::string(addr_.sun_path);
}
return reinterpret_cast <struct sockaddr *> (&addr_);
}
-prefix_ sockaddr const * senf::UNSocketAddress::sockaddr_p()
+prefix_ sockaddr const * senf::UNSocketAddress::sockaddr_p()
const
{
return reinterpret_cast <struct sockaddr const *> (&addr_);
#include <string>
#include <sys/socket.h>
#include <sys/un.h>
-#include <boost/cstdint.hpp>
-#include <boost/operators.hpp>
-#include "../../../Socket/SocketPolicy.hh"
-#include "../../../Socket/ClientSocketHandle.hh"
-#include "../../../Socket/CommunicationPolicy.hh"
#include "../../../Socket/Protocols/GenericAddressingPolicy.hh"
#include "../../../Utils/safe_bool.hh"
\implementation This implementation is based on sockaddr_un.
\ingroup addr_group
-
- \fixme Why both std::string constructor and from_string member ?
*/
class UNSocketAddress
: public comparable_safe_bool<UNSocketAddress>
{
public:
UNSocketAddress();
- explicit UNSocketAddress(std::string p);
+ explicit UNSocketAddress(std::string const & path);
///< Construct an address constant from given path
- static UNSocketAddress from_string(std::string const s);
- ///< Create UNSocketAddress from string
bool operator==(UNSocketAddress const & other) const;
///< Compare UNSocketAddress for equality