-
Notifications
You must be signed in to change notification settings - Fork 954
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #282 from edmBernard/master
Add unix socket support
- Loading branch information
Showing
5 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
#include "cpr/unix_socket.h" | ||
|
||
namespace cpr { | ||
|
||
const char* UnixSocket::GetUnixSocketString() const noexcept { | ||
return unix_socket_.data(); | ||
} | ||
|
||
} // namespace cpr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef CPR_UNIX_SOCKET_H | ||
#define CPR_UNIX_SOCKET_H | ||
|
||
#include <string> | ||
|
||
#include "cpr/defines.h" | ||
|
||
namespace cpr { | ||
|
||
class UnixSocket { | ||
public: | ||
template <typename UnixSocketType> | ||
UnixSocket(UnixSocketType&& unix_socket) | ||
: unix_socket_{CPR_FWD(unix_socket)} {} | ||
|
||
const char* GetUnixSocketString() const noexcept; | ||
|
||
private: | ||
std::string unix_socket_; | ||
}; | ||
|
||
} // namespace cpr | ||
|
||
#endif |