summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire.h
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/acquire.h')
-rw-r--r--apt-pkg/acquire.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h
index 57a74aa4d..a5f7a40c8 100644
--- a/apt-pkg/acquire.h
+++ b/apt-pkg/acquire.h
@@ -70,6 +70,7 @@
#include <apt-pkg/weakptr.h>
#include <chrono>
+#include <functional>
#include <string>
#include <vector>
@@ -330,6 +331,14 @@ class APT_PUBLIC pkgAcquire
* \return \b true if the directory exists and is readable.
*/
bool Clean(std::string Dir);
+
+ /** Deletes each package list and index file in the given directory.
+ *
+ * \param Dir The directory to be cleaned.
+ *
+ * \return \b true if the directory exists and is readable.
+ */
+ bool CleanLists(std::string Dir);
/** \return the total size in bytes of all the items included in
* this download.
@@ -372,6 +381,20 @@ class APT_PUBLIC pkgAcquire
private:
APT_HIDDEN void Initialize();
+
+ /** Delete each entry in the given directory whose name does \em not match
+ * a criterion.
+ *
+ * \param Dir The directory to be cleaned.
+ *
+ * \param KeepP A predicate telling to keep the named file; if it is
+ * non-empty and returns true, the file is kept.
+ *
+ * \param Caller Log name of the caller.
+ *
+ * \return \b true if the directory exists and is readable.
+ */
+ APT_HIDDEN static bool CleanDir(std::string Dir, std::function<bool(char const*)> const &KeepP, char const * const Caller);
};
/** \brief Represents a single download source from which an item