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

util.cpp File Reference

#include <msn/util.h>
#include <errno.h>
#include <cctype>

Namespaces

namespace  MSN

Functions

std::pair< std::string, int > splitServerAddress (const std::string &address, int default_port)
 Split a string containing a hostname and port number into its respective parts.
std::string decodeURL (const std::string &s)
 URL-decode a string.
std::string encodeURL (const std::string &s)
 URL-encode a string.
std::vector< std::string > splitString (const std::string &s, const std::string &sep, bool suppressBlanks)
 Split string at each occurence of separator.
int nocase_cmp (const std::string &s1, const std::string &s2)
 Compare two strings in a case insensitive fashion.
unsigned int decimalFromString (const std::string &s) throw (std::logic_error)
 Convert a string, s, that contains decimal digits into an unsigned int.


Function Documentation

unsigned int MSN::decimalFromString const std::string &  s  )  throw (std::logic_error)
 

Convert a string, s, that contains decimal digits into an unsigned int.

std::string MSN::decodeURL const std::string &  s  ) 
 

URL-decode a string.

Parameters:
s The URL-encoded string to decode.
Returns:
A string with all URL-encoded sequences replaced by their ASCII equivalent.

std::string MSN::encodeURL const std::string &  s  ) 
 

URL-encode a string.

Parameters:
s The string to encode.
Returns:
A string with all non-alphanumeric characters replaced by their URL-encoded equivalent.

int MSN::nocase_cmp const std::string &  s1,
const std::string &  s2
 

Compare two strings in a case insensitive fashion.

std::pair< std::string, int > MSN::splitServerAddress const std::string &  address,
int  default_port = 1863
 

Split a string containing a hostname and port number into its respective parts.

Parameters:
address A string in the form "hostname:port".
default_port A port number to return in the event that ":port" is omitted from address.
Returns:
A pair containing the hostname and port number.

std::vector< std::string > MSN::splitString const std::string &  string,
const std::string &  separator,
bool  suppressBlanks = true
 

Split string at each occurence of separator.


Generated on Sun Feb 6 19:59:40 2005 for libmsn by  doxygen 1.4.1