diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 09:59:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 09:59:37 +0000 |
commit | 76e2632459410dec81337edb6a9fee33c9a660f3 (patch) | |
tree | a73345df208eede4a4daad340515c9328f34625c /cmdline/apt-extracttemplates.h | |
parent | Initial commit. (diff) | |
download | apt-76e2632459410dec81337edb6a9fee33c9a660f3.tar.xz apt-76e2632459410dec81337edb6a9fee33c9a660f3.zip |
Adding upstream version 2.7.12.upstream/2.7.12
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmdline/apt-extracttemplates.h')
-rw-r--r-- | cmdline/apt-extracttemplates.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/cmdline/apt-extracttemplates.h b/cmdline/apt-extracttemplates.h new file mode 100644 index 0000000..bbd926e --- /dev/null +++ b/cmdline/apt-extracttemplates.h @@ -0,0 +1,49 @@ +// -*- mode: cpp; mode: fold -*- +// Description /*{{{*/ +/* ###################################################################### + + apt-extracttemplate - tool to extract template and config data + + ##################################################################### */ + /*}}}*/ +#ifndef _APTEXTRACTTEMPLATE_H_ +#define _APTEXTRACTTEMPLATE_H_ + +#include <apt-pkg/dirstream.h> +#include <apt-pkg/fileutl.h> + +#include <string> + +class pkgCache; + +class DebFile : public pkgDirStream +{ + FileFd File; + char *Control; + unsigned long ControlLen; + +public: + explicit DebFile(const char *FileName); + ~DebFile(); + bool DoItem(Item &I, int &fd) APT_OVERRIDE; + bool Process(pkgDirStream::Item &I, const unsigned char *data, + unsigned long long size, unsigned long long pos) APT_OVERRIDE; + + bool Go(); + bool ParseInfo(); + + static std::string GetInstalledVer(const std::string &package); + + std::string Package; + std::string Version; + std::string DepVer, PreDepVer; + unsigned int DepOp, PreDepOp; + + char *Config; + char *Template; + + static pkgCache *Cache; + enum { None, IsControl, IsConfig, IsTemplate } Which; +}; + +#endif |