Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Utils.cpp File Reference

#include <abuse/Utils.h>
#include <abuse/LocalizedMessages.h>
#include <algorithm>
#include <vector>
#include <locale>
#include <abuse/WaitableObject.h>
#include <abuse/RegEx.h>
#include <abuse/CommonRegEx.h>
#include <abuse/UrlRegex.h>


#define _INS(n, r)   ret.insert(map<string,Result>::value_type(MSG(n),r))


string codeToString (Result r) throw (std::runtime_error)
 return the string representation of Result, or runtime_error if invalid Result
Result stringToCode (const string &str) throw (std::runtime_error)
string getDomain (const string &email) throw (runtime_error)
bool similar (const string &s1, const string &s2)
std::vector< string > splitHost (const string &host)
string domainFromHostname (const string &host)
string tolow (const string &s)
string tolowCopy (const string &s)
string toAnsi (const wstring &wstr)
pair< size_t, size_t > nextWord (const string &where, size_t pos)
pair< size_t, size_t > isolateWord (const string &where, size_t pos)
size_t findWord (const string &where, const string &what, size_t pos)
size_t findWordInsens (const string &where, const string &what, size_t pos)
string skipchars (const string &str, const string &chars)
DWORD WaitForSingleObject (const WaitableObject *object, DWORD dwMillis)
DWORD WaitForMultipleObjects (DWORD dwHowMany, const WaitableObjectPtr *array, BOOL bWaitForAll, DWORD dwMillis)
size_t LocEmailInComment (const string &str, size_t pos)
string fetchKeyword (const string &line)
bool LocAbuseInLine (const string &str, size_t pos)
bool LocEmailAfterRefWord (const string &whoisstr, const string &refWord, std::list< std::string > &emails)
size_t FetchNextEmail (const string &str, size_t pos, std::list< std::string > &emails)
bool validIPv4address (const char *ip)
string validIpUrlFormat (const char *ipUrl, bool &isIpFormat)
string getPcreVersion ()
 get the pcre library version
static pair< size_t, size_t > isolateURL (const string &lowcase, size_t pos)
size_t FetchNextURL (const string &msg, size_t pos, string &strUrl)
string removeEscapeUrlChars (const char *chUrl)
string UrlDigitsToIPDot (string Url)


static const char VALIDCHARSX [] = "01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.@"
static const char VALIDCHARS [] = "01234567890abcdefghijklmnopqrstuvwxyz-_.@"
UrlAddress verifyUrlFormat
static const char VALIDURLCHARS [] = "01234567890abcdefghijklmnopqrstuvwxyz-_.@//=?*&%$#!;:"

Define Documentation

#define _INS n,
 )     ret.insert(map<string,Result>::value_type(MSG(n),r))

Function Documentation

string domainFromHostname const string &  host  ) 

string fetchKeyword const string &  line  ) 

size_t FetchNextEmail const string &  str,
size_t  pos,
std::list< std::string > &  emails

size_t FetchNextURL const string &  msg,
size_t  pos,
string &  strUrl

size_t findWord const string &  where,
const string &  what,
size_t  pos

size_t findWordInsens const string &  where,
const string &  what,
size_t  pos

string getDomain const string &  email  )  throw (runtime_error)

static pair<size_t,size_t> isolateURL const string &  lowcase,
size_t  pos

pair<size_t,size_t> isolateWord const string &  where,
size_t  pos

bool LocAbuseInLine const string &  str,
size_t  pos

bool LocEmailAfterRefWord const string &  whoisstr,
const string &  refWord,
std::list< std::string > &  emails

size_t LocEmailInComment const string &  str,
size_t  pos

pair<size_t,size_t> nextWord const string &  where,
size_t  pos

bool similar const string &  s1,
const string &  s2

string skipchars const string &  str,
const string &  chars

std::vector<string> splitHost const string &  host  ) 

Result stringToCode const string &  str  )  throw (std::runtime_error)

string toAnsi const wstring &  wstr  ) 

string tolow const string &  s  ) 

string tolowCopy const string &  s  ) 

string UrlDigitsToIPDot string  Url  ) 

DWORD WaitForMultipleObjects DWORD  dwHowMany,
const WaitableObjectPtr array,
BOOL  bWaitForAll,
DWORD  dwMillis

DWORD WaitForSingleObject const WaitableObject object,
DWORD  dwMillis

Variable Documentation

const char VALIDCHARS[] = "01234567890abcdefghijklmnopqrstuvwxyz-_.@" [static]

const char VALIDCHARSX[] = "01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.@" [static]

const char VALIDURLCHARS[] = "01234567890abcdefghijklmnopqrstuvwxyz-_.@//=?*&%$#!;:" [static]

UrlAddress verifyUrlFormat

Generated on Thu Jun 16 00:13:14 2005 for Netlib for Abuse! by  doxygen 1.4.3