Spm::Util Namespace Reference


Classes

class  Command
 Launch command and get their output. More...
class  FileNotFoundException
class  Compressed
 Base class for archive manipluation. More...
class  Output
class  Debug
class  NetException
struct  urlDetails
class  Object
 The base class for all objects Object is the base class for all objects. It provide the following. a name, owner, mutex attribute and a modified signal. More...
class  PropertyList
 A property container A property container. Property are identified by a name. There is 3 types recognized (Integer,String,boolean). More...
class  TranslationManager
 Manage translation. More...
class  UnknownUserException
class  NullPointerException
class  ArchiveException
class  NoPropertyException
class  BadPropertyTypeException
class  ExistingPropertyException

Functions

int getSocket (const std::string &host, int port) throw (NetException)
 get a connection to a host
void closeSocket (int &fdSocket)
 Close a connection.
void sendTo (int fdSocket, std::string &str) throw (NetException)
 send a string
char * recv (int fdSocket, int &size) throw (NetException)
 Receive a string from network.
urlDetails parseUrl (const std::string &url) throw (NetException)
 Parse an URL.
int getDefaultPortByService (const std::string &serviceName)
 Get the default port of a service.
bool isUrl (const std::string &str)
 Check if a string is an URL.
bool checkPath (const miniXml::ustring &path)
 Check if a path exist.
void removeDir (const miniXml::ustring &dir)
 Remove a directory and its content.
bool createDir (const miniXml::ustring &dir)
 create a directory
miniXml::ustring getUserName ()
boost::filesystem::path getUserHome ()
boost::filesystem::path getUserHome (const miniXml::ustring &user) throw (UnknownUserException)
boost::filesystem::path getSpmUserDir ()
boost::filesystem::path getSpmUserDir (const miniXml::ustring &user)
bool isRoot ()
void checkSpmDir (const boost::filesystem::path &dir)
 Check the Spm directory structure.
bool haveEnoughRight (const boost::filesystem::path &dir)
 Check that the user have write access to a dir.
template<class T>
miniXml::ustring toString (T t)
bool checkPath (const boost::filesystem::path &path)
 Check if a path exist.
int numberOfProcessors ()


Function Documentation

bool Spm::Util::checkPath ( const boost::filesystem::path &  path  )  [inline]

Check if a path exist.

Parameters:
path The path to check
Returns:
true if the path exist

bool Spm::Util::checkPath ( const miniXml::ustring &  path  ) 

Check if a path exist.

Parameters:
path The path to check
Returns:
true if the path exist
Deprecated:
Should be replaced by boost::filesystem::path

void Spm::Util::checkSpmDir ( const boost::filesystem::path &  dir  ) 

Check the Spm directory structure.

Parameters:
dir The Spm directory

void Spm::Util::closeSocket ( int &  fdSocket  ) 

Close a connection.

Parameters:
fdSocket The connection to close

bool Spm::Util::createDir ( const miniXml::ustring &  dir  ) 

create a directory

Parameters:
dir The directory to create
Deprecated:
Should be replaced by boost::filesystem::path

int Spm::Util::getDefaultPortByService ( const std::string &  serviceName  ) 

Get the default port of a service.

Parameters:
serviceName The name of the service
Returns:
The standard port of the service

int Spm::Util::getSocket ( const std::string &  host,
int  port 
) throw (NetException)

get a connection to a host

Parameters:
host The host address
port The port of the connection
Returns:
A connected socket

boost::filesystem::path Spm::Util::getSpmUserDir ( const miniXml::ustring &  user  ) 

Parameters:
user The username of the user
Returns:
The Spm directory of the user

boost::filesystem::path Spm::Util::getSpmUserDir (  ) 

Returns:
The Spm dir of the user

boost::filesystem::path Spm::Util::getUserHome ( const miniXml::ustring &  user  )  throw (UnknownUserException)

Parameters:
user The username of the user
Returns:
The home dir of the user

boost::filesystem::path Spm::Util::getUserHome (  ) 

Returns:
The home dir of the user

miniXml::ustring Spm::Util::getUserName (  ) 

Returns:
The name of the user

bool Spm::Util::haveEnoughRight ( const boost::filesystem::path &  dir  ) 

Check that the user have write access to a dir.

Parameters:
dir The directory to check
Returns:
true if the user have write access

bool Spm::Util::isRoot (  ) 

Returns:
true if the user is root

bool Spm::Util::isUrl ( const std::string &  str  ) 

Check if a string is an URL.

Parameters:
str The string to check
Returns:
true if the string is an URL

int Spm::Util::numberOfProcessors (  ) 

Returns:
The number of processors of the computer

urlDetails Spm::Util::parseUrl ( const std::string &  url  )  throw (NetException)

Parse an URL.

Parameters:
url The URL to parse
Returns:
The details of the parsed URL

char* Spm::Util::recv ( int  fdSocket,
int &  size 
) throw (NetException)

Receive a string from network.

Parameters:
fdSocket The socket
size The number of bytes to read (will also contains the number of really readen bytes)
Returns:
A buffer of size bytes

void Spm::Util::removeDir ( const miniXml::ustring &  dir  ) 

Remove a directory and its content.

Parameters:
dir The directory to remove
Deprecated:
Should be replaced by boost::filesystem::path

void Spm::Util::sendTo ( int  fdSocket,
std::string &  str 
) throw (NetException)

send a string

Parameters:
fdSocket A connection
str The string to send

template<class T>
miniXml::ustring Spm::Util::toString ( t  )  [inline]


Generated on Sat Mar 21 17:00:14 2009 for libSpm by  doxygen 1.5.2