#include <zlib.h>
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
/* Define this for python-apt */
#define APT_HAS_GZIP 1
return T;
}
- bool Open(std::string FileName,OpenMode Mode,CompressMode Compress,unsigned long const Perms = 0666);
- inline bool Open(std::string const &FileName,OpenMode Mode, unsigned long const Perms = 0666) {
+ bool Open(std::string FileName,unsigned int const Mode,CompressMode Compress,unsigned long const Perms = 0666);
+ bool Open(std::string FileName,unsigned int const Mode,APT::Configuration::Compressor const &compressor,unsigned long const Perms = 0666);
+ inline bool Open(std::string const &FileName,unsigned int const Mode, unsigned long const Perms = 0666) {
return Open(FileName, Mode, None, Perms);
};
- bool OpenDescriptor(int Fd, OpenMode Mode, CompressMode Compress, bool AutoClose=false);
- inline bool OpenDescriptor(int Fd, OpenMode Mode, bool AutoClose=false) {
+ bool OpenDescriptor(int Fd, unsigned int const Mode, CompressMode Compress, bool AutoClose=false);
+ bool OpenDescriptor(int Fd, unsigned int const Mode, APT::Configuration::Compressor const &compressor, bool AutoClose=false);
+ inline bool OpenDescriptor(int Fd, unsigned int const Mode, bool AutoClose=false) {
return OpenDescriptor(Fd, Mode, None, AutoClose);
};
bool Close();
inline bool IsCompressed() {return (Flags & Compressed) == Compressed;};
inline std::string &Name() {return FileName;};
- FileFd(std::string FileName,OpenMode Mode,unsigned long Perms = 0666) : iFd(-1), Flags(0), d(NULL)
+ FileFd(std::string FileName,unsigned int const Mode,unsigned long Perms = 0666) : iFd(-1), Flags(0), d(NULL)
{
Open(FileName,Mode, None, Perms);
};
- FileFd(std::string FileName,OpenMode Mode, CompressMode Compress, unsigned long Perms = 0666) : iFd(-1), Flags(0), d(NULL)
+ FileFd(std::string FileName,unsigned int const Mode, CompressMode Compress, unsigned long Perms = 0666) : iFd(-1), Flags(0), d(NULL)
{
Open(FileName,Mode, Compress, Perms);
};
FileFd() : iFd(-1), Flags(AutoClose), d(NULL) {};
- FileFd(int const Fd, OpenMode Mode = ReadWrite, CompressMode Compress = None) : iFd(-1), Flags(0), d(NULL)
+ FileFd(int const Fd, unsigned int const Mode = ReadWrite, CompressMode Compress = None) : iFd(-1), Flags(0), d(NULL)
{
OpenDescriptor(Fd, Mode, Compress);
};
private:
FileFdPrivate* d;
- bool OpenInternDescriptor(OpenMode Mode, CompressMode Compress);
+ bool OpenInternDescriptor(unsigned int const Mode, APT::Configuration::Compressor const &compressor);
};
bool RunScripts(const char *Cnf);
pid_t ExecFork();
bool ExecWait(pid_t Pid,const char *Name,bool Reap = false);
-bool ExecCompressor(APT::Configuration::Compressor const &Prog,
- pid_t *Pid, int const FileFd, int &OutFd, bool const Comp = true);
-inline bool ExecDecompressor(APT::Configuration::Compressor const &Prog,
- pid_t *Pid, int const FileFd, int &OutFd)
-{
- return ExecCompressor(Prog, Pid, FileFd, OutFd, true);
-}
-
// File string manipulators
std::string flNotDir(std::string File);
std::string flNotFile(std::string File);