Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

OS::Environment Class Reference

#include <Environment.h>

Inheritance diagram for OS::Environment:

Inheritance graph
[legend]
Collaboration diagram for OS::Environment:

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

static StringgetEnv (String *name)
static StringgetEnv (const char *name)
static void setEnv (String *name, String *value=nil)
static void setEnv (String *name, const char *value=NULL)
static void setEnv (const char *name, String *value=nil)
static void setEnv (const char *name, const char *value=NULL)

Member Function Documentation

String * Environment::getEnv const char *  name  )  [static]
 

Definition at line 38 of file Environment.cc.

References Core::Object::error(), and Core::GenericException::raise().

00039 {
00040     char *value;
00041     value = getenv(name);
00042     if (value == NULL) {
00043         Error *error = new KeyNotFoundError(__PRETTY_FUNCTION__, new String(name));
00044         error->raise();
00045     }
00046     return new String(value);
00047 }

String * Environment::getEnv String name  )  [static]
 

Definition at line 33 of file Environment.cc.

References Core::String::asCString().

00034 {
00035     return getEnv(name->asCString());
00036 }

void Environment::setEnv const char *  name,
const char *  value = NULL
[static]
 

Definition at line 65 of file Environment.cc.

00066 {
00067     if (value == NULL) unsetenv(name);
00068                   else setenv(name, value, 1);
00069 }

void Environment::setEnv const char *  name,
String value = nil
[static]
 

Definition at line 60 of file Environment.cc.

References Core::String::asCString(), nil, and setEnv().

00061 {
00062     setEnv(name, value == nil ? NULL : value->asCString());
00063 }

void Environment::setEnv String name,
const char *  value = NULL
[static]
 

Definition at line 55 of file Environment.cc.

References Core::String::asCString(), and setEnv().

00056 {
00057     setEnv(name->asCString(), value);
00058 }

void Environment::setEnv String name,
String value = nil
[static]
 

Definition at line 49 of file Environment.cc.

References Core::String::asCString(), and nil.

Referenced by setEnv().

00050 {
00051     setEnv(name->asCString(),
00052            value == nil ? NULL : value->asCString());
00053 }


The documentation for this class was generated from the following files:
Generated on Mon Nov 27 09:52:19 2006 for Smalltalk like C++ Class Library by  doxygen 1.4.2