The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
mha_stash_environment_variable_t Class Reference

This class changes the value of an environment variable when constructed and restores the original state of the environment variable when destroyed. More...

Public Member Functions

 mha_stash_environment_variable_t (const std::string &variable_name, const std::string &new_content)
 
 ~mha_stash_environment_variable_t ()
 

Private Attributes

const bool existed_before
 Flag indicates if the environment variable existed before constructor. More...
 
const std::string variable_name
 Name of environment variable. More...
 
const std::string original_content
 Content of environment variable before constructor executed. More...
 

Detailed Description

This class changes the value of an environment variable when constructed and restores the original state of the environment variable when destroyed.

Can be used for testing functionality related to environment variables.

Constructor & Destructor Documentation

◆ mha_stash_environment_variable_t()

mha_stash_environment_variable_t::mha_stash_environment_variable_t ( const std::string &  variable_name,
const std::string &  new_content 
)
inline

◆ ~mha_stash_environment_variable_t()

mha_stash_environment_variable_t::~mha_stash_environment_variable_t ( )
inline

Member Data Documentation

◆ existed_before

const bool mha_stash_environment_variable_t::existed_before
private

Flag indicates if the environment variable existed before constructor.

◆ variable_name

const std::string mha_stash_environment_variable_t::variable_name
private

Name of environment variable.

◆ original_content

const std::string mha_stash_environment_variable_t::original_content
private

Content of environment variable before constructor executed.


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