Loading...
Searching...
No Matches
casacore::EnvironmentVariable Class Reference
casa package (libcasa_casa) » OS_module

More...

`#include <EnvVar.h>`

## Static Public Member Functions

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.
static void | set (const String &name, const String &value)
| Define environment variable.

## Private Member Functions

| EnvironmentVariable ()
| This class is not meant to be constructed.

## Detailed Description

This class allows for getting enviroment variables

### Intended use:

Public interface

### Review Status

Reviewed By:
  Paul Shannon
Date Reviewed:
  1995/02/08
Test programs:
  tEnvVar

### 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;
}
casacore::EnvironmentVariable::get
static String get(const String &name)
Get the value of environment variable with given name.
casacore::EnvironmentVariable::isDefined
static Bool isDefined(const String &name)
Is environment variable with given name defined?

Definition at line 60 of file EnvVar.h.

## Constructor & Destructor Documentation

## EnvironmentVariable()

casacore::EnvironmentVariable::EnvironmentVariable | ( |  | ) |

private

This class is not meant to be constructed.

## Member Function Documentation

## get()

String casacore::EnvironmentVariable::get | ( | const String & | name | ) |

static

Get the value of environment variable with given name.

If not defined, return an empty String.

References casacore::name().

## isDefined()

Bool casacore::EnvironmentVariable::isDefined | ( | const String & | name | ) |

static

Is environment variable with given name defined?

References casacore::name().

## set()

void casacore::EnvironmentVariable::set | ( | const String & | name,
|  | const String & | value )

static

Define environment variable.

If it already exists, its value will be overwritten.

References casacore::name(), and casacore::NewDelAllocator< T >::value.

The documentation for this class was generated from the following file:

- casa/OS/EnvVar.h