1 #ifndef ENVIRONMENT_CLASS
2 #define ENVIRONMENT_CLASS
6 // Author : Chris Koeritz
8 // Copyright (c) 1994-$now By Author. This program is free software; you can
9 // redistribute it and/or modify it under the terms of the GNU General Public
10 // License as published by the Free Software Foundation:
11 // http://www.gnu.org/licenses/gpl.html
12 // or under the terms of the GNU Library license:
13 // http://www.gnu.org/licenses/lgpl.html
14 // at your preference. Those licenses describe your legal rights to this
15 // software, and no other rights or warranties apply.
16 // Please send updates for this code to: fred@gruntose.com -- Thanks, fred.
20 #include "definitions.h"
24 //! Provides access to the system's environment variables.
26 class environment : public virtual root_object
29 static astring get(const astring &variable_name);
30 //!< looks up the "variable_name" in the current environment variables.
31 /*!< this returns the value for "variable_name" as it was found in the
32 operating system's environment variables that are defined at this point
33 in time for the user and process. the returned string will be empty if no
34 variable under that name could be found. */
36 // static astring get(const char *variable_name) { return get(astring(variable_name)); }
37 //!< synonym using simpler char pointer.
39 static bool set(const astring &variable_name, const astring &value);
40 //!< adds or creates "variable_name" in the environment.
41 /*!< changes the current set of environment variables by adding or
42 modifying the "variable_name". its new value will be "value". */
44 // static bool set(const char *variable_name, const char *value)
45 // { return set(astring(variable_name), astring(value)); }
46 //!< synonym using simpler char pointers.
48 static basis::un_int system_uptime();
49 //!< gives the operating system's uptime in a small form that rolls over.