X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/479a2beb0f5605652689d74a78dd224b69ba2e8f..1afd369d00f2f9272462ffc6c6e24f293a81459e:/apt-pkg/contrib/fileutl.h?ds=inline diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index a9cb45e9a..9402c8f75 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -78,6 +78,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 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); bool Skip(unsigned long long To); bool Truncate(unsigned long long To); @@ -148,6 +149,10 @@ class FileFd private: FileFdPrivate* d; bool OpenInternDescriptor(unsigned int const Mode, APT::Configuration::Compressor const &compressor); + + // private helpers to set Fail flag and call _error->Error + bool FileFdErrno(const char* Function, const char* Description,...) __like_printf(3) __cold; + bool FileFdError(const char* Description,...) __like_printf(2) __cold; }; bool RunScripts(const char *Cnf); @@ -180,7 +185,7 @@ pid_t ExecFork(); bool ExecWait(pid_t Pid,const char *Name,bool Reap = false); // check if the given file starts with a PGP cleartext signature -bool IsPgpClearTextSignature(std::string const &FileName); +bool StartsWithGPGClearTextSignature(std::string const &FileName); // File string manipulators std::string flNotDir(std::string File); @@ -189,6 +194,7 @@ std::string flNoLink(std::string File); std::string flExtension(std::string File); std::string flCombine(std::string Dir,std::string File); - +// simple c++ glob +std::vector Glob(std::string const &pattern, int flags=0); #endif