summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:50:57 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:50:57 +0000
commit8ce4327bc0d3f2695b936391c856cc80de6c0d83 (patch)
tree1ba165575c80bb48909f56b2c1e875524c65ebab /apt-pkg/contrib
parent1a7c9eba99a9521a7722be37d6bafe5fa4936630 (diff)
More progress updates
Author: jgg Date: 1998-08-26 04:52:23 GMT More progress updates
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/fileutl.cc14
-rw-r--r--apt-pkg/contrib/fileutl.h5
-rw-r--r--apt-pkg/contrib/progress.cc12
-rw-r--r--apt-pkg/contrib/progress.h3
4 files changed, 30 insertions, 4 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index b29b2e098..d18f7853e 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: fileutl.cc,v 1.6 1998/07/19 04:42:12 jgg Exp $
+// $Id: fileutl.cc,v 1.7 1998/08/26 04:52:26 jgg Exp $
/* ######################################################################
File Utilities
@@ -107,6 +107,18 @@ string SafeGetCWD()
return S;
}
/*}}}*/
+// flNotDir - Strip the directory from the filename /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+string flNotDir(string File)
+{
+ string::size_type Res = File.rfind('/');
+ if (Res == string::npos)
+ return File;
+ Res++;
+ return string(File,Res,Res - File.length());
+}
+ /*}}}*/
// FileFd::FileFd - Open a file /*{{{*/
// ---------------------------------------------------------------------
diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h
index b53b499ab..a99d5fee6 100644
--- a/apt-pkg/contrib/fileutl.h
+++ b/apt-pkg/contrib/fileutl.h
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: fileutl.h,v 1.4 1998/07/19 04:42:13 jgg Exp $
+// $Id: fileutl.h,v 1.5 1998/08/26 04:52:27 jgg Exp $
/* ######################################################################
File Utilities
@@ -64,4 +64,7 @@ int GetLock(string File,bool Errors = true);
bool FileExists(string File);
string SafeGetCWD();
+// File string manipulators
+string flNotDir(string File);
+
#endif
diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc
index 4be7b87b9..074de0805 100644
--- a/apt-pkg/contrib/progress.cc
+++ b/apt-pkg/contrib/progress.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: progress.cc,v 1.5 1998/08/23 03:52:22 jgg Exp $
+// $Id: progress.cc,v 1.6 1998/08/26 04:52:28 jgg Exp $
/* ######################################################################
OpProgress - Operation Progress
@@ -60,6 +60,16 @@ void OpProgress::SubProgress(unsigned long SubTotal,string Op)
Update();
}
/*}}}*/
+// OpProgress::SubProgress - Set the sub progress state /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+void OpProgress::SubProgress(unsigned long SubTotal)
+{
+ this->SubTotal = SubTotal;
+ Percent = Current*100.0/Total;
+ Update();
+}
+ /*}}}*/
// OpProgress::CheckChange - See if the display should be updated /*{{{*/
// ---------------------------------------------------------------------
/* Progress calls are made so frequently that if every one resulted in
diff --git a/apt-pkg/contrib/progress.h b/apt-pkg/contrib/progress.h
index e3530cdcb..554cb16ea 100644
--- a/apt-pkg/contrib/progress.h
+++ b/apt-pkg/contrib/progress.h
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: progress.h,v 1.2 1998/08/23 03:52:23 jgg Exp $
+// $Id: progress.h,v 1.3 1998/08/26 04:52:29 jgg Exp $
/* ######################################################################
OpProgress - Operation Progress
@@ -56,6 +56,7 @@ class OpProgress
public:
void Progress(unsigned long Current);
+ void SubProgress(unsigned long SubTotal);
void SubProgress(unsigned long SubTotal,string Op);
void OverallProgress(unsigned long Current,unsigned long Total,
unsigned long Size,string Op);