libapt-pkg-dev  v0.9.7.5ubuntu5.4
Debian+Ubuntu APT Package Management
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
strutl.h File Reference
#include <stdlib.h>
#include <string>
#include <cstring>
#include <vector>
#include <iostream>
#include <time.h>
#include "macros.h"
Include dependency graph for strutl.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  RxChoiceList
 
struct  SubstVar
 
class  URI
 

Macros

#define APT_MKSTRCMP(name, func)
 
#define APT_MKSTRCMP2(name, func)
 

Functions

char * _strstrip (char *String)
 
char * _strtabexpand (char *String, size_t Len)
 
bool Base256ToNum (const char *Str, unsigned long &Res, unsigned int Len)
 
std::string Base64Encode (const std::string &Str)
 
bool CheckDomainList (const std::string &Host, const std::string &List)
 
std::string DeEscapeString (const std::string &input)
 
const char * DeNull (const char *s)
 
std::string DeQuoteString (const std::string &Str)
 
std::string DeQuoteString (std::string::const_iterator const &begin, std::string::const_iterator const &end)
 
bool FTPMDTMStrToTime (const char *const str, time_t &time)
 
bool Hex2Num (const std::string &Str, unsigned char *Num, unsigned int Length)
 
void ioprintf (std::ostream &out, const char *format,...)
 
std::string LookupTag (const std::string &Message, const char *Tag, const char *Default=0)
 
std::string OutputInDepth (const unsigned long Depth, const char *Separator=" ")
 
bool ParseCWord (const char *&String, std::string &Res)
 
bool ParseQuoteWord (const char *&String, std::string &Res)
 
std::string QuoteString (const std::string &Str, const char *Bad)
 
bool ReadMessages (int Fd, std::vector< std::string > &List)
 
unsigned long RegexChoice (RxChoiceList *Rxs, const char **ListBegin, const char **ListEnd)
 
bool RFC1123StrToTime (const char *const str, time_t &time)
 
char * safe_snprintf (char *Buffer, char *End, const char *Format,...)
 
std::string SizeToStr (double Bytes)
 
int stringcasecmp (const char *A, const char *AEnd, const char *B, const char *BEnd)
 
int stringcasecmp (const std::string &A, const std::string &B)
 
int stringcasecmp (const char *A, const char *AEnd, const char *B)
 
int stringcasecmp (const std::string &A, const char *B, const char *BEnd)
 
int stringcasecmp (const std::string &A, const char *B)
 
int stringcmp (const char *A, const char *AEnd, const char *B, const char *BEnd)
 
int stringcmp (const std::string &A, const char *B, const char *BEnd)
 
int stringcmp (const char *A, const char *AEnd, const char *B)
 
int stringcmp (const std::string &A, const std::string &B)
 
int stringcmp (const std::string &A, const char *B)
 
int StringToBool (const std::string &Text, int Default=-1)
 
std::string StripEpoch (const std::string &VerStr)
 
void strprintf (std::string &out, const char *format,...)
 
bool StrToNum (const char *Str, unsigned long &Res, unsigned Len, unsigned Base=0)
 
bool StrToNum (const char *Str, unsigned long long &Res, unsigned Len, unsigned Base=0)
 
bool StrToTime (const std::string &Val, time_t &Result)
 
std::string SubstVar (std::string Str, const struct SubstVar *Vars)
 
std::string SubstVar (const std::string &Str, const std::string &Subst, const std::string &Contents)
 
std::string TimeRFC1123 (time_t Date)
 
std::string TimeToStr (unsigned long Sec)
 
bool TokSplitString (char Tok, char *Input, char **List, unsigned long ListMax)
 
int tolower_ascii (int const c)
 
std::string URItoFileName (const std::string &URI)
 
bool UTF8ToCodeset (const char *codeset, const std::string &orig, std::string *dest)
 
std::vector< std::string > VectorizeString (std::string const &haystack, char const &split)
 

Macro Definition Documentation

#define APT_MKSTRCMP (   name,
  func 
)
Value:
inline int name(const char *A,const char *B) {return func(A,A+strlen(A),B,B+strlen(B));}; \
inline int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));}; \
inline int name(const std::string& A,const char *B) {return func(A.c_str(),A.c_str()+A.length(),B,B+strlen(B));}; \
inline int name(const std::string& A,const std::string& B) {return func(A.c_str(),A.c_str()+A.length(),B.c_str(),B.c_str()+B.length());}; \
inline int name(const std::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 
)
Value:
inline int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));}; \
inline int name(const std::string& A,const char *B) {return func(A.begin(),A.end(),B,B+strlen(B));}; \
inline int name(const std::string& A,const std::string& B) {return func(A.begin(),A.end(),B.begin(),B.end());}; \
inline int name(const std::string& A,const char *B,const char *BEnd) {return func(A.begin(),A.end(),B,BEnd);};

Function Documentation

char* _strstrip ( char *  String)
char* _strtabexpand ( char *  String,
size_t  Len 
)
bool Base256ToNum ( const char *  Str,
unsigned long &  Res,
unsigned int  Len 
)
std::string Base64Encode ( const std::string &  Str)
bool CheckDomainList ( const std::string &  Host,
const std::string &  List 
)
std::string DeEscapeString ( const std::string &  input)
const char* DeNull ( const char *  s)
inline
std::string DeQuoteString ( const std::string &  Str)
std::string DeQuoteString ( std::string::const_iterator const &  begin,
std::string::const_iterator const &  end 
)
bool FTPMDTMStrToTime ( const char *const  str,
time_t &  time 
)
bool Hex2Num ( const std::string &  Str,
unsigned char *  Num,
unsigned int  Length 
)

Referenced by HashSumValue< N >::Set().

Here is the caller graph for this function:

void ioprintf ( std::ostream &  out,
const char *  format,
  ... 
)
std::string LookupTag ( const std::string &  Message,
const char *  Tag,
const char *  Default = 0 
)
std::string OutputInDepth ( const unsigned long  Depth,
const char *  Separator = "  " 
)
bool ParseCWord ( const char *&  String,
std::string &  Res 
)
bool ParseQuoteWord ( const char *&  String,
std::string &  Res 
)
std::string QuoteString ( const std::string &  Str,
const char *  Bad 
)
bool ReadMessages ( int  Fd,
std::vector< std::string > &  List 
)
unsigned long RegexChoice ( RxChoiceList Rxs,
const char **  ListBegin,
const char **  ListEnd 
)
bool RFC1123StrToTime ( const char *const  str,
time_t &  time 
)
char* safe_snprintf ( char *  Buffer,
char *  End,
const char *  Format,
  ... 
)
std::string SizeToStr ( double  Bytes)
int stringcasecmp ( const char *  A,
const char *  AEnd,
const char *  B,
const char *  BEnd 
)
int stringcasecmp ( const std::string &  A,
const std::string &  B 
)
inline
int stringcasecmp ( const char *  A,
const char *  AEnd,
const char *  B 
)
inline
int stringcasecmp ( const std::string &  A,
const char *  B,
const char *  BEnd 
)
inline
int stringcasecmp ( const std::string &  A,
const char *  B 
)
inline
int stringcmp ( const char *  A,
const char *  AEnd,
const char *  B,
const char *  BEnd 
)
int stringcmp ( const std::string &  A,
const char *  B,
const char *  BEnd 
)
inline
int stringcmp ( const char *  A,
const char *  AEnd,
const char *  B 
)
inline
int stringcmp ( const std::string &  A,
const std::string &  B 
)
inline
int stringcmp ( const std::string &  A,
const char *  B 
)
inline
int StringToBool ( const std::string &  Text,
int  Default = -1 
)
std::string StripEpoch ( const std::string &  VerStr)
void strprintf ( std::string &  out,
const char *  format,
  ... 
)
bool StrToNum ( const char *  Str,
unsigned long &  Res,
unsigned  Len,
unsigned  Base = 0 
)
bool StrToNum ( const char *  Str,
unsigned long long &  Res,
unsigned  Len,
unsigned  Base = 0 
)
bool StrToTime ( const std::string &  Val,
time_t &  Result 
)
std::string SubstVar ( std::string  Str,
const struct SubstVar Vars 
)
std::string SubstVar ( const std::string &  Str,
const std::string &  Subst,
const std::string &  Contents 
)
std::string TimeRFC1123 ( time_t  Date)
std::string TimeToStr ( unsigned long  Sec)
bool TokSplitString ( char  Tok,
char *  Input,
char **  List,
unsigned long  ListMax 
)
int tolower_ascii ( int const  c)
std::string URItoFileName ( const std::string &  URI)
bool UTF8ToCodeset ( const char *  codeset,
const std::string &  orig,
std::string *  dest 
)
std::vector<std::string> VectorizeString ( std::string const &  haystack,
char const &  split 
)