X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/88749b5dc18eb5708af20185e4339e76bda6fb72..77e274f5ad23d79294f28ecc9868fc6f534214a4:/apt-pkg/contrib/fileutl.h diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 8619047a0..15665f8b5 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -45,6 +45,7 @@ class FileFd friend class GzipFileFdPrivate; friend class Bz2FileFdPrivate; friend class LzmaFileFdPrivate; + friend class Lz4FileFdPrivate; friend class DirectFileFdPrivate; friend class PipedFileFdPrivate; protected: @@ -75,7 +76,7 @@ class FileFd ReadOnlyGzip, WriteAtomic = ReadWrite | Create | Atomic }; - enum CompressMode { Auto = 'A', None = 'N', Extension = 'E', Gzip = 'G', Bzip2 = 'B', Lzma = 'L', Xz = 'X' }; + enum CompressMode { Auto = 'A', None = 'N', Extension = 'E', Gzip = 'G', Bzip2 = 'B', Lzma = 'L', Xz = 'X', Lz4='4' }; inline bool Read(void *To,unsigned long long Size,bool AllowEof) { @@ -85,6 +86,7 @@ class FileFd return Read(To,Size); } bool Read(void *To,unsigned long long Size,unsigned long long *Actual = 0); + bool static Read(int const Fd, void *To, unsigned long long Size, unsigned long long * const Actual = 0); char* ReadLine(char *To, unsigned long long const Size); bool Flush(); bool Write(const void *From,unsigned long long Size); @@ -162,7 +164,7 @@ bool RemoveFile(char const * const Function, std::string const &FileName); int GetLock(std::string File,bool Errors = true); bool FileExists(std::string File); bool RealFileExists(std::string File); -bool DirectoryExists(std::string const &Path) APT_CONST; +bool DirectoryExists(std::string const &Path); bool CreateDirectory(std::string const &Parent, std::string const &Path); time_t GetModificationTime(std::string const &Path); bool Rename(std::string From, std::string To); @@ -233,6 +235,8 @@ std::string flCombine(std::string Dir,std::string File); /** \brief Takes a file path and returns the absolute path */ std::string flAbsPath(std::string File); +/** \brief removes superfluous /./ and // from path */ +APT_HIDDEN std::string flNormalize(std::string file); // simple c++ glob std::vector Glob(std::string const &pattern, int flags=0);