15 #include <sys/socket.h>
43 if(!allowBlank && 0 == thePath.size()) {
44 throw std::invalid_argument(
"thePath cannot be blank");
48 throw std::invalid_argument(
"thePath is too long for this system");
74 LocalAddress::LocalAddress(
const std::string& thePath,
bool allowBlank)
78 if(
nullptr == pimpl) {
79 throw new std::invalid_argument(
"Invalid path");
92 if(AF_LOCAL != lowLevelAddress->getSockAddr().sa_family) {
93 throw std::invalid_argument(
"LowLevelAddress is of wrong type for LocalAddress to create");
96 const struct sockaddr_un& ref = *
reinterpret_cast<const struct sockaddr_un*
>(&lowLevelAddress->getSockAddr());
Base class for all addresses.
std::shared_ptr< Address > Ptr
Local Socket Address (formerly Unix Domain Socket) Address representing a named pipe's name.
const std::string & getPath() const
virtual std::shared_ptr< LowLevelAddress > makeTempLowLevelAddress() const
std::shared_ptr< LocalAddress > Ptr
static LocalAddress::Ptr create(const std::string &thePath)
virtual LowLevelAddress & getLowLevelAddress() const
The private implementation of LocalAddress.
LocalAddressPimpl(const std::string &thePath, bool allowBlank)
Interface for the low-level address implementation.
std::shared_ptr< LowLevelAddress > Ptr
LowLevelAddress template for the various cast-to-sockaddr implementaitons.
Namespace of the BsdSockets library.
LowLevelAddressType< struct sockaddr_un > LocalLowLevelAddress