summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.h
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib/fileutl.h')
-rw-r--r--apt-pkg/contrib/fileutl.h32
1 files changed, 11 insertions, 21 deletions
diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h
index 97cb05c56..acfd560ab 100644
--- a/apt-pkg/contrib/fileutl.h
+++ b/apt-pkg/contrib/fileutl.h
@@ -130,28 +130,17 @@ class FileFd
inline bool Eof() {return (Flags & HitEof) == HitEof;};
inline bool IsCompressed() {return (Flags & Compressed) == Compressed;};
inline std::string &Name() {return FileName;};
-
- FileFd(std::string FileName,unsigned int const Mode,unsigned long AccessMode = 0666) : iFd(-1), Flags(0), d(NULL)
- {
- Open(FileName,Mode, None, AccessMode);
- };
- FileFd(std::string FileName,unsigned int const Mode, CompressMode Compress, unsigned long AccessMode = 0666) : iFd(-1), Flags(0), d(NULL)
- {
- Open(FileName,Mode, Compress, AccessMode);
- };
- FileFd() : iFd(-1), Flags(AutoClose), d(NULL) {};
- FileFd(int const Fd, unsigned int const Mode = ReadWrite, CompressMode Compress = None) : iFd(-1), Flags(0), d(NULL)
- {
- OpenDescriptor(Fd, Mode, Compress);
- };
- FileFd(int const Fd, bool const AutoClose) : iFd(-1), Flags(0), d(NULL)
- {
- OpenDescriptor(Fd, ReadWrite, None, AutoClose);
- };
+
+ FileFd(std::string FileName,unsigned int const Mode,unsigned long AccessMode = 0666);
+ FileFd(std::string FileName,unsigned int const Mode, CompressMode Compress, unsigned long AccessMode = 0666);
+ FileFd();
+ FileFd(int const Fd, unsigned int const Mode = ReadWrite, CompressMode Compress = None);
+ FileFd(int const Fd, bool const AutoClose);
virtual ~FileFd();
private:
- FileFdPrivate* d;
+ FileFdPrivate * d;
+ APT_HIDDEN FileFd & operator=(const FileFd &);
APT_HIDDEN bool OpenInternDescriptor(unsigned int const Mode, APT::Configuration::Compressor const &compressor);
// private helpers to set Fail flag and call _error->Error
@@ -170,8 +159,9 @@ time_t GetModificationTime(std::string const &Path);
bool Rename(std::string From, std::string To);
std::string GetTempDir();
-FileFd* GetTempFile(std::string const &Prefix = "",
- bool ImmediateUnlink = true);
+FileFd* GetTempFile(std::string const &Prefix = "",
+ bool ImmediateUnlink = true,
+ FileFd * const TmpFd = NULL);
/** \brief Ensure the existence of the given Path
*