BESUtil.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef E_BESUtil_h
00034 #define E_BESUtil_h 1
00035
00036 #include <string>
00037 #include <list>
00038 #include <iostream>
00039
00040 using std::string ;
00041 using std::list ;
00042 using std::ostream ;
00043
00044 class BESUtil
00045 {
00046 private:
00047 static string rfc822_date( const time_t t ) ;
00048
00049 static string entity( char c ) ;
00050 public:
00060 static void set_mime_text( ostream &strm ) ;
00061 static void set_mime_html( ostream &strm ) ;
00062
00064 static string www2id( const string &in,
00065 const string &escape = "%",
00066 const string &except = "" ) ;
00067 static string unhexstring( string s ) ;
00068
00070 static string lowercase( const string &s ) ;
00071
00073 static string unescape( const string &s ) ;
00074
00076 static void check_path( const string &path,
00077 const string &root,
00078 bool follow_sym_links ) ;
00079
00081 static char * fastpidconverter( char *buf,
00082 int base ) ;
00083 static char * fastpidconverter( long val,
00084 char *buf,
00085 int base ) ;
00086
00088 static void removeLeadingAndTrailingBlanks( string &key ) ;
00089
00091 static string id2xml( string in,
00092 const string ¬_allowed = "><&'\"" ) ;
00093
00095 static string xml2id( string in ) ;
00096
00098 static void explode( char delim, const string &str,
00099 list<string> &values ) ;
00100
00102 static string implode( const list<string> &values,
00103 char delim ) ;
00104 } ;
00105
00106 #endif // E_BESUtil_h
00107