From fa3b09450ed3da175f619ca77d9dceb9a6f81972 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 29 Jun 2009 18:23:07 +0200 Subject: merge r1797 from lp:~donkult/apt/experimental --- apt-pkg/contrib/strutl.cc | 11 +++++++++++ apt-pkg/contrib/strutl.h | 1 + apt-pkg/depcache.cc | 9 +-------- 3 files changed, 13 insertions(+), 8 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index a69cf01ec..61c582b85 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -387,6 +387,17 @@ string SubstVar(string Str,const struct SubstVar *Vars) return Str; } /*}}}*/ +// OutputInDepth - return a string with separator multiplied with depth /*{{{*/ +// --------------------------------------------------------------------- +/* Returns a string with the supplied separator depth + 1 times in it */ +std::string OutputInDepth(const unsigned long Depth, const char* Separator) +{ + std::string output = ""; + for(unsigned long d=Depth+1; d > 0; d--) + output.append(Separator); + return output; +} + /*}}}*/ // URItoFileName - Convert the uri into a unique file name /*{{{*/ // --------------------------------------------------------------------- /* This converts a URI into a safe filename. It quotes all unsafe characters diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index 53146ced7..2450bd421 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -48,6 +48,7 @@ string DeQuoteString(const string &Str); string SizeToStr(double Bytes); string TimeToStr(unsigned long Sec); string Base64Encode(const string &Str); +string OutputInDepth(const unsigned long Depth, const char* Separator=" "); string URItoFileName(const string &URI); string TimeRFC1123(time_t Date); bool StrToTime(const string &Val,time_t &Result); diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index fcc6f4a4e..9f734cca2 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -47,14 +48,6 @@ ConfigValueInSubTree(const char* SubTree, const char *needle) return false; } -std::string OutputInDepth(const unsigned long Depth) -{ - std::string output = ""; - for(unsigned long d=Depth; d > 0; d--) - output += " "; - return output; -} - pkgDepCache::ActionGroup::ActionGroup(pkgDepCache &cache) : cache(cache), released(false) { -- cgit v1.2.3