]>
Commit | Line | Data |
---|---|---|
6c139d6e AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
0a8a80e5 | 3 | // $Id: strutl.h,v 1.6 1998/10/22 04:56:49 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> | |
0a8a80e5 | 23 | #include <vector> |
6c139d6e AL |
24 | |
25 | char *_strstrip(char *String); | |
26 | char *_strtabexpand(char *String,size_t Len); | |
27 | bool ParseQuoteWord(const char *&String,string &Res); | |
08e8f724 | 28 | bool ParseCWord(const char *String,string &Res); |
6c139d6e AL |
29 | string QuoteString(string Str,const char *Bad); |
30 | string SizeToStr(double Bytes); | |
31 | string TimeToStr(unsigned long Sec); | |
32 | string SubstVar(string Str,string Subst,string Contents); | |
33 | string Base64Encode(string Str); | |
ad00ae81 | 34 | string URItoFileName(string URI); |
3b5421b4 | 35 | string URIAccess(string URI); |
0a8a80e5 AL |
36 | string TimeRFC1123(time_t Date); |
37 | string LookupTag(string Message,const char *Tag,const char *Default = 0); | |
38 | int StringToBool(string Text,int Default = -1); | |
39 | bool ReadMessages(int Fd, vector<string> &List); | |
6c139d6e AL |
40 | |
41 | int stringcmp(const char *A,const char *AEnd,const char *B,const char *BEnd); | |
9c14e3d6 | 42 | inline int stringcmp(const char *A,const char *AEnd,const char *B) {return stringcmp(A,AEnd,B,B+strlen(B));}; |
6c139d6e | 43 | int stringcasecmp(const char *A,const char *AEnd,const char *B,const char *BEnd); |
9c14e3d6 | 44 | inline int stringcasecmp(const char *A,const char *AEnd,const char *B) {return stringcasecmp(A,AEnd,B,B+strlen(B));}; |
6c139d6e AL |
45 | |
46 | #endif |