diff options
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r-- | apt-pkg/contrib/md5.cc | 4 | ||||
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 6 | ||||
-rw-r--r-- | apt-pkg/contrib/strutl.h | 15 |
3 files changed, 15 insertions, 10 deletions
diff --git a/apt-pkg/contrib/md5.cc b/apt-pkg/contrib/md5.cc index 046135f5e..671d61d06 100644 --- a/apt-pkg/contrib/md5.cc +++ b/apt-pkg/contrib/md5.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: md5.cc,v 1.1 1998/10/31 05:19:59 jgg Exp $ +// $Id: md5.cc,v 1.2 1998/11/01 05:27:36 jgg Exp $ /* ###################################################################### MD5Sum - MD5 Message Digest Algorithm. @@ -40,7 +40,7 @@ /*}}}*/ // Include Files /*{{{*/ #ifdef __GNUG__ -#pragma interface "apt-pkg/md5.h" +#pragma implementation "apt-pkg/md5.h" #endif #include <apt-pkg/md5.h> diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index d6a7143e4..2c3106ceb 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: strutl.cc,v 1.9 1998/10/30 07:53:45 jgg Exp $ +// $Id: strutl.cc,v 1.10 1998/11/01 05:27:37 jgg Exp $ /* ###################################################################### String Util - Some usefull string functions. @@ -609,10 +609,10 @@ bool StrToTime(string Val,time_t &Result) } /*}}}*/ -// URI::URI - Constructor /*{{{*/ +// URI::CopyFrom - Copy from an object /*{{{*/ // --------------------------------------------------------------------- /* This parses the URI into all of its components */ -URI::URI(string U) +void URI::CopyFrom(string U) { string::const_iterator I = U.begin(); diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index 7e3e47344..f93184a24 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: strutl.h,v 1.8 1998/10/30 07:53:46 jgg Exp $ +// $Id: strutl.h,v 1.9 1998/11/01 05:27:38 jgg Exp $ /* ###################################################################### String Util - These are some usefull string functions @@ -13,8 +13,6 @@ ##################################################################### */ /*}}}*/ -// This is a private header -// Header section: / #ifndef STRUTL_H #define STRUTL_H @@ -40,11 +38,15 @@ bool ReadMessages(int Fd, vector<string> &List); int stringcmp(const char *A,const char *AEnd,const char *B,const char *BEnd); inline int stringcmp(const char *A,const char *AEnd,const char *B) {return stringcmp(A,AEnd,B,B+strlen(B));}; +inline int stringcmp(string A,const char *B) {return stringcmp(A.begin(),A.end(),B,B+strlen(B));}; int stringcasecmp(const char *A,const char *AEnd,const char *B,const char *BEnd); inline int stringcasecmp(const char *A,const char *AEnd,const char *B) {return stringcasecmp(A,AEnd,B,B+strlen(B));}; +inline int stringcasecmp(string A,const char *B) {return stringcasecmp(A.begin(),A.end(),B,B+strlen(B));}; class URI { + void CopyFrom(string From); + public: string Access; @@ -54,9 +56,12 @@ class URI string Path; unsigned int Port; - operator string(); + inline operator string(); + inline operator =(string From) {CopyFrom(From);}; + inline bool empty() {return Access.empty();}; - URI(string Path); + URI(string Path) {CopyFrom(Path);}; + URI() : Port(0) {}; }; #endif |