diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:58:16 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:58:16 +0000 |
commit | 47db89970b749eb28a4fd616fc944c00b5153a62 (patch) | |
tree | 064d92b2260377d5ae4240833bcb758c834fb0d5 /apt-pkg/contrib/strutl.h | |
parent | d935bb170bacf117fdc433778402e41a45ad8d1b (diff) |
Reverted CheckDomainList and LookupTag while adding new...
Author: jgg
Date: 2001-05-29 04:40:34 GMT
Reverted CheckDomainList and LookupTag while adding new comparision functions for iterators
Diffstat (limited to 'apt-pkg/contrib/strutl.h')
-rw-r--r-- | apt-pkg/contrib/strutl.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index 7112c8da7..872338919 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.19 2001/05/27 05:55:27 jgg Exp $ +// $Id: strutl.h,v 1.20 2001/05/29 04:40:34 jgg Exp $ /* ###################################################################### String Util - These are some useful string functions @@ -65,11 +65,26 @@ inline int name(string A,const char *B) {return func(A.c_str(),A.c_str()+A.lengt inline int name(string A,string B) {return func(A.c_str(),A.c_str()+A.length(),B.c_str(),B.c_str()+B.length());}; \ inline int name(string A,const char *B,const char *BEnd) {return func(A.c_str(),A.c_str()+A.length(),B,BEnd);}; +#define APT_MKSTRCMP2(name,func) \ +inline int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));}; \ +inline int name(string A,const char *B) {return func(A.begin(),A.end(),B,B+strlen(B));}; \ +inline int name(string A,string B) {return func(A.begin(),A.end(),B.begin(),B.end());}; \ +inline int name(string A,const char *B,const char *BEnd) {return func(A.begin(),A.end(),B,BEnd);}; \ +inline int name(string::const_iterator A,string::const_iterator Aend,const char *B) {return func(A,Aend,B,B+strlen(B));}; + int stringcmp(const char *A,const char *AEnd,const char *B,const char *BEnd); +int stringcmp(string::const_iterator A,string::const_iterator AEnd, + const char *B,const char *BEnd); +int stringcmp(string::const_iterator A,string::const_iterator AEnd, + string::const_iterator B,string::const_iterator BEnd); int stringcasecmp(const char *A,const char *AEnd,const char *B,const char *BEnd); +int stringcasecmp(string::const_iterator A,string::const_iterator AEnd, + const char *B,const char *BEnd); +int stringcasecmp(string::const_iterator A,string::const_iterator AEnd, + string::const_iterator B,string::const_iterator BEnd); -APT_MKSTRCMP(stringcmp,stringcmp); -APT_MKSTRCMP(stringcasecmp,stringcasecmp); +APT_MKSTRCMP2(stringcmp,stringcmp); +APT_MKSTRCMP2(stringcasecmp,stringcasecmp); inline const char *DeNull(const char *s) {return (s == 0?"(null)":s);}; |