Interface nsIEnvironmentType

Scriptable access to the current process environment.

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Check the existence of an environment variable. This method checks whether an environment variable is present in the environment or not.

    • For Unix/Linux platforms we follow the Unix definition: An environment variable exists when |getenv()| returns a non-NULL value. An environment variable does not exist when |getenv()| returns NULL.
    • For non-Unix/Linux platforms we have to fall back to a "portable" definition (which is incorrect for Unix/Linux!!!!) which simply checks whether the string returned by |Get()| is empty or not.

    Returns

    if the variable has been set, the value returned is PR_TRUE. If the variable was not defined in the environment PR_FALSE will be returned.

    Parameters

    • aName: string

      the variable name to probe.

    Returns boolean

  • Get the value of an environment variable.

    Returns

    returns the value of the env variable. An empty string will be returned when the env variable does not exist or when the value itself is an empty string - please use |exists()| to probe whether the env variable exists or not.

    Parameters

    • aName: string

      the variable name to retrieve.

    Returns string

  • Set the value of an environment variable.

    Parameters

    • aName: string

      the variable name to set.

    • aValue: string

      the value to set.

    Returns void

Generated using TypeDoc