EnvVar.h

Classes

EnvironmentVariable -- This class allows for getting enviroment variables (full description)

class EnvironmentVariable

Interface

Public Members
static Bool isDefined (const String& name)
static String get (const String& name)
static void set (const String& name, const String& value)
Private Members
EnvironmentVariable()

Description

Review Status

Reviewed By:
Paul Shannon, pshannon@nrao.edu
Date Reviewed:
1995/02/08
Programs:
Tests:

Synopsis

Environment variables are familiar to every Unix, MSDOS and VMS computer user. This class makes it convenient to get and enquire about environment variables from within a C++ program.

Example

Check if an environment variable is defined. If so, get its value.
  if (EnvironmentVariable::isDefined ("PATH")) {
    cout << EnvironmentVariable::get ("PATH") << endl;
  }

To Do

Member Description

static Bool isDefined (const String& name)

Is environment variable with given name defined?

static String get (const String& name)

Get the value of environment variable with given name. If not defined, return an empty String.

static void set (const String& name, const String& value)

Define environment variable. If it already exists, its value will be overwritten.

EnvironmentVariable()

This class is not meant to be constructed.