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
30 //!< provides a single place to get the temporary directory.
31 /*!< this will locate the value of the TMP variable and return it. if the TMP
32 variable is not currently defined, this will try to do something reasonable for
35 static astring get(const astring &variable_name);
36 //!< looks up the "variable_name" in the current environment variables.
37 /*!< this returns the value for "variable_name" as it was found in the
38 operating system's environment variables that are defined at this point
39 in time for the user and process. the returned string will be empty if no
40 variable under that name could be found. */
42 static bool set(const astring &variable_name, const astring &value);
43 //!< adds or creates "variable_name" in the environment.
44 /*!< changes the current set of environment variables by adding or
45 modifying the "variable_name". its new value will be "value". */
47 static basis::un_int system_uptime();
48 //!< gives the operating system's uptime in a small form that rolls over.