PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
phoenix_env.h File Reference
#include "PString.h"
+ Include dependency graph for phoenix_env.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

PString phoenix_getenv (const PString &varName)
 Get the value of the given environment variable. More...
 
bool phoenix_setenv (const PString &name, const PString &value, bool overwrite=true)
 Set a environment variable. More...
 
bool phoenix_unsetenv (const PString &name)
 Unset a environment variable. More...
 

Function Documentation

◆ phoenix_getenv()

PString phoenix_getenv ( const PString varName)

Get the value of the given environment variable.

Parameters
varName: name of the environment variable to be used
Returns
value of the variable, or empty string of the variable does not exist

Definition at line 15 of file phoenix_env.cpp.

15  {
16  return phoenix_charToString(getenv(varName.c_str()));
17 }
PString phoenix_charToString(const char *ch)
Convert a char pointer into a string (event if the char pointer is NULL)
Definition: PString.cpp:14

References phoenix_charToString().

Referenced by PPath::getCurrentDirectory(), PPath::getHomeDir(), and testEnv().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ phoenix_setenv()

bool phoenix_setenv ( const PString name,
const PString value,
bool  overwrite 
)

Set a environment variable.

Parameters
name: name of the variable to be created
value: value of the variable to be created
overwrite: true to overwrite an existing variable, false to not to
Returns
true on success, false otherwise

Definition at line 25 of file phoenix_env.cpp.

25  {
26  return setenv(name.c_str(), value.c_str(), overwrite) == 0;
27 }

Referenced by testEnv().

+ Here is the caller graph for this function:

◆ phoenix_unsetenv()

bool phoenix_unsetenv ( const PString name)

Unset a environment variable.

Parameters
name: name of the variable to be unset
Returns
true on success, false otherwise

Definition at line 33 of file phoenix_env.cpp.

33  {
34  return unsetenv(name.c_str()) == 0;
35 }

Referenced by testEnv().

+ Here is the caller graph for this function: