From 492f957ad42ce5eee7e26f3edd5789af296b7460 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:51:18 +0000 Subject: Http method Author: jgg Date: 1998-11-04 07:10:49 GMT Http method --- apt-pkg/contrib/configuration.h | 3 ++- apt-pkg/contrib/strutl.cc | 21 ++++++++++++++++++--- apt-pkg/contrib/strutl.h | 9 +++++++-- 3 files changed, 27 insertions(+), 6 deletions(-) (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/configuration.h b/apt-pkg/contrib/configuration.h index cf5a90f57..c5c32ef2f 100644 --- a/apt-pkg/contrib/configuration.h +++ b/apt-pkg/contrib/configuration.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: configuration.h,v 1.7 1998/10/30 07:53:44 jgg Exp $ +// $Id: configuration.h,v 1.8 1998/11/04 07:11:12 jgg Exp $ /* ###################################################################### Configuration Class @@ -52,6 +52,7 @@ class Configuration public: string Find(const char *Name,const char *Default = 0); + string Find(string Name,const char *Default = 0) {return Find(Name.c_str(),Default);}; string FindFile(const char *Name,const char *Default = 0); string FindDir(const char *Name,const char *Default = 0); int FindI(const char *Name,int Default = 0); diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 5efa6f60b..c99f88c3f 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.11 1998/11/01 08:07:12 jgg Exp $ +// $Id: strutl.cc,v 1.12 1998/11/04 07:11:13 jgg Exp $ /* ###################################################################### String Util - Some usefull string functions. @@ -15,13 +15,16 @@ ##################################################################### */ /*}}}*/ // Includes /*{{{*/ +#ifdef __GNUG__ +#pragma implementation "strutl.h" +#endif + #include #include #include #include #include -#include /*}}}*/ // strstrip - Remove white space from the front and back of a string /*{{{*/ @@ -695,6 +698,7 @@ URI::operator string() string Res = Access + ':'; if (Host.empty() == false) { + Res += "//"; if (User.empty() == false) { Res += "//" + User; @@ -703,10 +707,21 @@ URI::operator string() Res += "@"; } Res += Host; + if (Port != 0) + { + char S[30]; + sprintf(S,":%u",Port); + Res += S; + } } if (Path.empty() == false) - Res += "/" + Path; + { + if (Path[0] != '/') + Res += "/" + Path; + else + Res += Path; + } return Res; } diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index f93184a24..10d835ba3 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.9 1998/11/01 05:27:38 jgg Exp $ +// $Id: strutl.h,v 1.10 1998/11/04 07:11:14 jgg Exp $ /* ###################################################################### String Util - These are some usefull string functions @@ -16,9 +16,14 @@ #ifndef STRUTL_H #define STRUTL_H +#ifdef __GNUG__ +#pragma interface "strutl.h" +#endif + #include #include #include +#include char *_strstrip(char *String); char *_strtabexpand(char *String,size_t Len); @@ -56,7 +61,7 @@ class URI string Path; unsigned int Port; - inline operator string(); + operator string(); inline operator =(string From) {CopyFrom(From);}; inline bool empty() {return Access.empty();}; -- cgit v1.2.3