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

Utilities


Classes

class  EmailExtractor
 Extract all email addresses from a string. More...

Functions

std::string getDomain (const std::string &email) throw (std::runtime_error)
 return the domain (right of @) part of an email
std::string codeToString (Result r) throw (std::runtime_error)
 return the string representation of Result, or runtime_error if invalid Result
Result stringToCode (const std::string &s) throw (std::runtime_error)
 return the result code given a string representation, throw a runtime_error if not found
bool similar (const std::string &s1, const std::string &s2)
 return true if s1 is "similar" to s2, please look at impl to know what I mean
std::string domainFromHostname (const std::string &host)
 extract the domain part of an URL
std::string tolow (const std::string &)
 convert to lower case
std::string tolowCopy (const std::string &)
 convert to lower case, does not change the arg
std::string toAnsi (const std::wstring &)
 convert from wstring to string
std::string skipchars (const std::string &str, const std::string &chars=" \t")
 "trim" the string from the specified chars
size_t findWordInsens (const std::string &where, const std::string &what, size_t pos=0)
size_t findWord (const std::string &where, const std::string &what, size_t pos0)
 find a substring into a string, "case does matter" version
std::pair< size_t, size_t > nextWord (const std::string &where, size_t pos)
std::pair< size_t, size_t > isolateWord (const std::string &where, size_t pos)
std::string fetchKeyword (const std::string &line)
size_t LocEmailInComment (const std::string &str, size_t pos)
bool LocAbuseInLine (const std::string &str, size_t pos)
size_t FetchNextEmail (const std::string &str, size_t pos, std::list< std::string > &emails)
size_t FetchNextURL (const std::string &str, size_t pos, std::string &strUrl)
bool LocEmailAfterRefWord (const std::string &whoisstr, const std::string &refWord, std::list< std::string > &emails)
bool validIPv4address (const char *ip)
std::string validIpUrlFormat (const char *ipUrl, bool &isIpFormat)
std::string getPcreVersion ()
 get the pcre library version
std::string UrlDigitsToIPDot (std::string Url)
std::string removeEscapeUrlChars (const char *chUrl)
__inline const char * getComputerName ()
 return computer's name

Detailed Description

Utility functions and classes

Function Documentation

std::string codeToString Result  r  )  throw (std::runtime_error)
 

return the string representation of Result, or runtime_error if invalid Result

Parameters:
r :the result to be converted
Returns:
a string representation of the result
Exceptions:
std::runtime_error if the Result cannot be translated to a string
See also:
Result

std::string domainFromHostname const std::string &  host  ) 
 

extract the domain part of an URL

Parameters:
host is a const ref to a hostname
Returns:
the domain part of the hostname

std::string fetchKeyword const std::string &  line  ) 
 

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

size_t FetchNextURL const std::string &  str,
size_t  pos,
std::string &  strUrl
 

size_t findWord const std::string &  where,
const std::string &  what,
size_t  pos0
 

find a substring into a string, "case does matter" version

Parameters:
where is the string to search into
what is the substring to be searched into where
pos is the offset from the start of the string where to start the search
Returns:
is the position of the substring in the string, or string::npos if there are no occurences of the substring in the string

size_t findWordInsens const std::string &  where,
const std::string &  what,
size_t  pos = 0
 

Parameters:
where is the string to search into
what is the substring to be searched into where
pos is the offset from the start of the string where to start the search
Returns:
is the position of the substring in the string, or string::npos if there are no occurences of the substring in the string

__inline const char* getComputerName  ) 
 

return computer's name

Returns:
is the computer name
Warning:
The function returns a pointer to a static buffer; don't try to modify the return value via a cast

std::string getDomain const std::string &  email  )  throw (std::runtime_error)
 

return the domain (right of @) part of an email

Parameters:
email :the email whose domain has to be extracted
Returns:
the domain part of the email address
Exceptions:
std::runtime_error is something goes wrong

std::string getPcreVersion  ) 
 

get the pcre library version

Returns:
is a string representation of the pcre library version

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

bool LocAbuseInLine const std::string &  str,
size_t  pos
 

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

size_t LocEmailInComment const std::string &  str,
size_t  pos
 

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

std::string removeEscapeUrlChars const char *  chUrl  ) 
 

bool similar const std::string &  s1,
const std::string &  s2
 

return true if s1 is "similar" to s2, please look at impl to know what I mean

std::string skipchars const std::string &  str,
const std::string &  chars = " \t"
 

"trim" the string from the specified chars

Parameters:
str is the string to be trimmed
chars is a string of chars that must be elided from str's ends (both begin and end)
Returns:
the trimmed string

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

return the result code given a string representation, throw a runtime_error if not found

Parameters:
s is the string representation to be converted
Returns:
the Result type of the string
Exceptions:
std::runtime_error if the string cannot be converted to a Result
See also:
Result

std::string toAnsi const std::wstring &   ) 
 

convert from wstring to string

Parameters:
the wide string to be converted
Returns:
the string equivalent to the wstring param

std::string tolow const std::string &   ) 
 

convert to lower case

Parameters:
host is the string to be converted to lower case
Returns:
the lower case repr of the arg

std::string tolowCopy const std::string &   ) 
 

convert to lower case, does not change the arg

See also:
tolow
Warning:
this function is needed because of a bug in MSVC6 stdc++ library

std::string UrlDigitsToIPDot std::string  Url  ) 
 

std::string validIpUrlFormat const char *  ipUrl,
bool &  isIpFormat
 

bool validIPv4address const char *  ip  ) 
 


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