claw::system_info Class Reference

A class to get some informations about the system in which your program runs. More...

#include <system_info_unix.hpp>

List of all members.

Static Public Member Functions

static std::string get_user_name ()
 Get the name of the user (the name used for the connection).
static std::string get_user_directory ()
 Get the path of the user's personnal directory.
template<typename Sequence >
static void get_path (Sequence &path)
 Get system's paths.
static std::string get_host_name ()
 Get the name of out host.
static std::string get_temporary_directory ()
 Get the path of the directory used by the system to save temporary files.
static std::string get_environment (const std::string &var)
 Get an environment variable.
static std::string get_user_name ()
 Get the name of the user (the name used for the connection).
static std::string get_user_directory ()
 Get the path of the user's personnal directory.
template<typename Sequence >
static void get_path (Sequence &path)
 Get system's paths.
static std::string get_host_name ()
 Get the name of our host.
static std::string get_temporary_directory ()
 Get the path of the directory used by the system to save temporary files.
static std::string get_environment (const std::string &var)
 Get an environment variable.

Detailed Description

A class to get some informations about the system in which your program runs.

Author:
Julien Jorge

Definition at line 44 of file system_info_unix.hpp.


Member Function Documentation

static std::string claw::system_info::get_environment ( const std::string &  var  )  [inline, static]

Get an environment variable.

Parameters:
var The name of the variable to get.

Definition at line 99 of file system_info_win32.hpp.

00100     {
00101       char* value = getenv( var.c_str() );
00102       std::string result;
00103 
00104       if ( value )
00105   result = value;
00106 
00107       return result;
00108     } // get_environment()

static std::string claw::system_info::get_environment ( const std::string &  var  )  [inline, static]

Get an environment variable.

Parameters:
var The name of the variable to get.

Definition at line 104 of file system_info_unix.hpp.

Referenced by get_host_name(), get_temporary_directory(), get_user_directory(), and get_user_name().

00105     {
00106       char* value = getenv( var.c_str() );
00107       std::string result;
00108 
00109       if ( value )
00110   result = value;
00111 
00112       return result;
00113     } // get_environment()

static std::string claw::system_info::get_host_name (  )  [inline, static]

Get the name of our host.

Definition at line 79 of file system_info_win32.hpp.

References get_environment().

00080     {
00081       return get_environment("COMPUTERNAME");
00082     } // get_host_name()

static std::string claw::system_info::get_host_name (  )  [inline, static]

Get the name of out host.

Definition at line 84 of file system_info_unix.hpp.

References get_environment().

00085     {
00086       return get_environment("HOSTNAME");
00087     } // get_host_name()

template<typename Sequence >
static void claw::system_info::get_path ( Sequence &  path  )  [inline, static]

Get system's paths.

Definition at line 70 of file system_info_win32.hpp.

00071     {
00072       //
00073     } // get_path()

template<typename Sequence >
static void claw::system_info::get_path ( Sequence &  path  )  [inline, static]

Get system's paths.

Definition at line 75 of file system_info_unix.hpp.

00076     {
00077       //
00078     } // get_path()

static std::string claw::system_info::get_temporary_directory (  )  [inline, static]

Get the path of the directory used by the system to save temporary files.

Definition at line 89 of file system_info_win32.hpp.

References get_environment().

00090     {
00091       return get_environment("TEMP");
00092     } // get_temporary_directory()

static std::string claw::system_info::get_temporary_directory (  )  [inline, static]

Get the path of the directory used by the system to save temporary files.

Definition at line 94 of file system_info_unix.hpp.

References get_environment().

00095     {
00096       return get_environment("TMPDIR");
00097     } // get_temporary_directory()

static std::string claw::system_info::get_user_directory (  )  [inline, static]

Get the path of the user's personnal directory.

Definition at line 60 of file system_info_win32.hpp.

References get_environment().

00061     {
00062       return get_environment("USERPROFILE");
00063     } // get_user_directory()

static std::string claw::system_info::get_user_directory (  )  [inline, static]

Get the path of the user's personnal directory.

Definition at line 65 of file system_info_unix.hpp.

References get_environment().

00066     {
00067       return get_environment("HOME");
00068     } // get_user_directory()

static std::string claw::system_info::get_user_name (  )  [inline, static]

Get the name of the user (the name used for the connection).

Definition at line 51 of file system_info_win32.hpp.

References get_environment().

00052     {
00053       return get_environment("USERNAME");
00054     } // get_user_name()

static std::string claw::system_info::get_user_name (  )  [inline, static]

Get the name of the user (the name used for the connection).

Definition at line 51 of file system_info_unix.hpp.

References get_environment().

00052     {
00053       std::string result( get_environment("USER") );
00054 
00055       if ( result == "" )
00056   result = get_environment("LOGNAME");
00057 
00058       return result;
00059     } // get_user_name()


The documentation for this class was generated from the following files:

Generated on 9 Nov 2009 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.6.1