Environment
[Functions and Macros by Category]


Detailed Description

These functions allow access to get or change the values of environment variables in a portable way. They are currently implemented under Win32 and POSIX-like systems (Unix).

wxChar * wxGetenv (const wxString &var)
bool wxGetEnv (const wxString &var, wxString *value)
bool wxSetEnv (const wxString &var, const wxString &value)
bool wxUnsetEnv (const wxString &var)

Function Documentation

bool wxGetEnv ( const wxString var,
wxString value 
)

Returns the current value of the environment variable var in value. value may be NULL if you just want to know if the variable exists and are not interested in its value.

Returns true if the variable exists, false otherwise.

Include file:

#include <wx/utils.h> 

wxChar* wxGetenv ( const wxString var  ) 

This is a macro defined as getenv() or its wide char version in Unicode mode.

Note that under Win32 it may not return correct value for the variables set with wxSetEnv(), use wxGetEnv() function instead.

Include file:

#include <wx/utils.h> 

bool wxSetEnv ( const wxString var,
const wxString value 
)

Sets the value of the environment variable var (adding it if necessary) to value.

Returns true on success.

See also:
wxUnsetEnv()
Include file:
#include <wx/utils.h> 

bool wxUnsetEnv ( const wxString var  ) 

Removes the variable var from the environment. wxGetEnv() will return NULL after the call to this function.

Returns true on success.

Include file:

#include <wx/utils.h> 



wxWidgets logo

[ top ]