posix/fd: add std::string overloads for paths
This commit is contained in:
parent
98732179a7
commit
51c8ee84ca
12
posix/fd.cpp
12
posix/fd.cpp
@ -43,6 +43,18 @@ fd::fd (const char *path, int flags, mode_t mode):
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
fd::fd (const std::string &path, int flags):
|
||||
fd (path.c_str (), flags)
|
||||
{ ; }
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
fd::fd (const std::string &path, int flags, mode_t mode):
|
||||
fd (path.c_str (), flags, mode)
|
||||
{ ; }
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
fd::fd (fd &&rhs):
|
||||
m_fd (-1)
|
||||
|
@ -17,6 +17,8 @@
|
||||
#ifndef __CRUFT_UTIL_POSIX_FD_HPP
|
||||
#define __CRUFT_UTIL_POSIX_FD_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
@ -26,6 +28,8 @@ namespace util::posix {
|
||||
class fd {
|
||||
public:
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
fd (const std::string &path, int flags);
|
||||
fd (const std::string &path, int flags, mode_t);
|
||||
fd (const char *path, int flags);
|
||||
fd (const char *path, int flags, mode_t);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user