PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
phoenix_env.cpp
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 #include <stdlib.h>
8 #include "phoenix_env.h"
9 
10 
12 
15 PString phoenix_getenv(const PString & varName){
16  return phoenix_charToString(getenv(varName.c_str()));
17 }
18 
20 
25 bool phoenix_setenv(const PString & name, const PString & value, bool overwrite){
26  return setenv(name.c_str(), value.c_str(), overwrite) == 0;
27 }
28 
30 
33 bool phoenix_unsetenv(const PString & name){
34  return unsetenv(name.c_str()) == 0;
35 }
36 
37 
PString phoenix_charToString(const char *ch)
Convert a char pointer into a string (event if the char pointer is NULL)
Definition: PString.cpp:14
Extends the std::string.
Definition: PString.h:16
bool phoenix_setenv(const PString &name, const PString &value, bool overwrite)
Set a environment variable.
Definition: phoenix_env.cpp:25
bool phoenix_unsetenv(const PString &name)
Unset a environment variable.
Definition: phoenix_env.cpp:33
PString phoenix_getenv(const PString &varName)
Get the value of the given environment variable.
Definition: phoenix_env.cpp:15