X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/591fd938c3840c4e49d684087a3340e1f0b40020..3010fb0e069d2fd4c7a6ade4559bfb659bf8f2fb:/apt-pkg/contrib/fileutl.h?ds=inline diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 041aa3309..528725f89 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -21,11 +21,10 @@ #ifndef PKGLIB_FILEUTL_H #define PKGLIB_FILEUTL_H -#ifdef __GNUG__ -#pragma interface "apt-pkg/fileutl.h" -#endif +#include #include +#include using std::string; @@ -35,9 +34,10 @@ class FileFd int iFd; enum LocalFlags {AutoClose = (1<<0),Fail = (1<<1),DelOnFail = (1<<2), - HitEof = (1<<3)}; + HitEof = (1<<3), Replace = (1<<4) }; unsigned long Flags; string FileName; + string TemporaryFileName; public: enum OpenMode {ReadOnly,WriteEmpty,WriteExists,WriteAny,WriteTemp}; @@ -80,9 +80,16 @@ class FileFd virtual ~FileFd(); }; +bool RunScripts(const char *Cnf); bool CopyFile(FileFd &From,FileFd &To); int GetLock(string File,bool Errors = true); bool FileExists(string File); +bool DirectoryExists(string const &Path) __attrib_const; +bool CreateDirectory(string const &Parent, string const &Path); +std::vector GetListOfFilesInDir(string const &Dir, string const &Ext, + bool const &SortList, bool const &AllowNoExt=false); +std::vector GetListOfFilesInDir(string const &Dir, std::vector const &Ext, + bool const &SortList); string SafeGetCWD(); void SetCloseExec(int Fd,bool Close); void SetNonBlock(int Fd,bool Block);