From d016834e39f668449385b1668240bdf905d62ade Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 28 Sep 2012 14:43:39 +0200 Subject: add new ClearAll --- apt-pkg/contrib/configuration.cc | 11 +++++++++++ apt-pkg/contrib/configuration.h | 1 + 2 files changed, 12 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index 36866a35a..43533e5bb 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -403,6 +403,17 @@ void Configuration::Clear(string const &Name, string const &Value) } } +} + /*}}}*/ +// Configuration::ClearAll - Clear everything /*{{{*/ +void Configuration::ClearAll() +{ + const Configuration::Item *Top = Tree(0); + while( Top != 0 ) + { + Clear(Top->FullTag()); + Top = Top->Next; + } } /*}}}*/ // Configuration::Clear - Clear an entire tree /*{{{*/ diff --git a/apt-pkg/contrib/configuration.h b/apt-pkg/contrib/configuration.h index 4c2e75041..181ef696b 100644 --- a/apt-pkg/contrib/configuration.h +++ b/apt-pkg/contrib/configuration.h @@ -94,6 +94,7 @@ class Configuration // clear a whole tree void Clear(const std::string &Name); + void ClearAll(); // remove a certain value from a list (e.g. the list of "APT::Keep-Fds") void Clear(std::string const &List, std::string const &Value); -- cgit v1.2.3