diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:54:16 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:54:16 +0000 |
commit | 13d87e2e0f84512bc139637635b1e5025fa82a6c (patch) | |
tree | aa40b4ff29cde5f7e937a238284a8abb337ce582 /apt-pkg/contrib/fileutl.h | |
parent | d64663d4456b9b755af220a511de98c6d4bd4af3 (diff) |
Added an open function
Author: jgg
Date: 1999-07-11 22:42:32 GMT
Added an open function
Diffstat (limited to 'apt-pkg/contrib/fileutl.h')
-rw-r--r-- | apt-pkg/contrib/fileutl.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 8a1083241..e24f9cfb6 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: fileutl.h,v 1.18 1999/04/20 05:02:09 jgg Exp $ +// $Id: fileutl.h,v 1.19 1999/07/11 22:42:32 jgg Exp $ /* ###################################################################### File Utilities @@ -45,6 +45,7 @@ class FileFd bool Truncate(unsigned long To); unsigned long Tell(); unsigned long Size(); + bool Open(string FileName,OpenMode Mode,unsigned long Perms = 0666); bool Close(); // Simple manipulators @@ -56,7 +57,11 @@ class FileFd inline void OpFail() {Flags |= Fail;}; inline string &Name() {return FileName;}; - FileFd(string FileName,OpenMode Mode,unsigned long Perms = 0666); + FileFd(string FileName,OpenMode Mode,unsigned long Perms = 0666) : iFd(-1), + Flags(0) + { + Open(FileName,Mode,Perms); + }; FileFd(int Fd = -1) : iFd(Fd), Flags(AutoClose) {}; FileFd(int Fd,bool) : iFd(Fd), Flags(0) {}; virtual ~FileFd(); |