]> git.saurik.com Git - apt.git/blame - apt-pkg/contrib/strutl.h
Added the remove command
[apt.git] / apt-pkg / contrib / strutl.h
CommitLineData
6c139d6e
AL
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
08e8f724 3// $Id: strutl.h,v 1.4 1998/09/22 05:30:29 jgg Exp $
6c139d6e
AL
4/* ######################################################################
5
6 String Util - These are some usefull string functions
7
8 _strstrip is a function to remove whitespace from the front and end
9 of a string.
10
11 This source is placed in the Public Domain, do with it what you will
12 It was originally written by Jason Gunthorpe <jgg@gpu.srv.ualberta.ca>
13
14 ##################################################################### */
15 /*}}}*/
16// This is a private header
17// Header section: /
18#ifndef STRUTL_H
19#define STRUTL_H
20
21#include <stdlib.h>
22#include <string>
23
24char *_strstrip(char *String);
25char *_strtabexpand(char *String,size_t Len);
26bool ParseQuoteWord(const char *&String,string &Res);
08e8f724 27bool ParseCWord(const char *String,string &Res);
6c139d6e
AL
28string QuoteString(string Str,const char *Bad);
29string SizeToStr(double Bytes);
30string TimeToStr(unsigned long Sec);
31string SubstVar(string Str,string Subst,string Contents);
32string Base64Encode(string Str);
ad00ae81 33string URItoFileName(string URI);
6c139d6e
AL
34
35int stringcmp(const char *A,const char *AEnd,const char *B,const char *BEnd);
9c14e3d6 36inline int stringcmp(const char *A,const char *AEnd,const char *B) {return stringcmp(A,AEnd,B,B+strlen(B));};
6c139d6e 37int stringcasecmp(const char *A,const char *AEnd,const char *B,const char *BEnd);
9c14e3d6 38inline int stringcasecmp(const char *A,const char *AEnd,const char *B) {return stringcasecmp(A,AEnd,B,B+strlen(B));};
6c139d6e
AL
39
40#endif