X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/fa89055f13726dcc07f9fe14b5f1e8a7af210d61..f3de2dbaf657f9040a4da448c57267de0fef7d33:/apt-pkg/contrib/fileutl.h diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 57d3ab841..c13613171 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: @@ -66,6 +67,7 @@ class FileFd Exclusive = (1 << 3), Atomic = Exclusive | (1 << 4), Empty = (1 << 5), + BufferedWrite = (1 << 6), WriteEmpty = ReadWrite | Create | Empty, WriteExists = ReadWrite, @@ -74,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 +87,7 @@ class FileFd } bool Read(void *To,unsigned long long Size,unsigned long long *Actual = 0); char* ReadLine(char *To, unsigned long long const Size); + bool Flush(); bool Write(const void *From,unsigned long long Size); bool static Write(int Fd, const void *From, unsigned long long Size); bool Seek(unsigned long long To); @@ -231,6 +234,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);