zypp::base::Fd Class Reference
[RAII solutions]
Assert close
called on open filedescriptor.
More...
#include <Fd.h>
List of all members.
Public Member Functions |
| Fd (const Pathname &file_r, int open_flags, mode_t mode=0) |
| Ctor opens file.
|
| ~Fd () |
| Dtor closes file.
|
void | close () |
| Explicitly close the file.
|
bool | isOpen () const |
| Test for valid filedescriptor.
|
int | fd () const |
| Return the filedescriptor.
|
Private Member Functions |
| Fd (const Fd &) |
| No copy.
|
Fd & | operator= (const Fd &) |
| No assign.
|
Private Attributes |
int | m_fd |
| The filedescriptor.
|
Detailed Description
Assert close
called on open filedescriptor.
- Todo:
- It's dumb. Openflags and more related functions (read/write..) could be added.
Definition at line 44 of file Fd.h.
Constructor & Destructor Documentation
zypp::base::Fd::Fd |
( |
const Pathname & |
file_r, |
|
|
int |
open_flags, |
|
|
mode_t |
mode = 0 | |
|
) |
| | |
zypp::base::Fd::~Fd |
( |
|
) |
[inline] |
Dtor closes file.
Definition at line 53 of file Fd.h.
References close().
zypp::base::Fd::Fd |
( |
const Fd & |
|
) |
[private] |
Member Function Documentation
void zypp::base::Fd::close |
( |
|
) |
|
Explicitly close the file.
Definition at line 49 of file Fd.cc.
References m_fd.
Referenced by ~Fd().
bool zypp::base::Fd::isOpen |
( |
|
) |
const [inline] |
Test for valid filedescriptor.
Definition at line 60 of file Fd.h.
References m_fd.
int zypp::base::Fd::fd |
( |
|
) |
const [inline] |
Return the filedescriptor.
Definition at line 64 of file Fd.h.
References m_fd.
Fd& zypp::base::Fd::operator= |
( |
const Fd & |
|
) |
[private] |
Member Data Documentation
The documentation for this class was generated from the following files: