KiCad PCB EDA Suite
env_vars.h File Reference

Functions to provide helpful hints about what environment vars do. More...

#include <wx/string.h>
#include <vector>

Go to the source code of this file.

Typedefs

using ENV_VAR_LIST = std::vector< wxString >
 

Functions

bool IsEnvVarImmutable (const wxString &aEnvVar)
 Determine if an environment variable is "predefined", i.e. More...
 
const ENV_VAR_LISTGetPredefinedEnvVars ()
 Get the list of pre-defined environment variables. More...
 
wxString LookUpEnvVarHelp (const wxString &aEnvVar)
 Look up long-form help text for a given environment variable. More...
 

Detailed Description

Functions to provide helpful hints about what environment vars do.

Definition in file env_vars.h.

Typedef Documentation

using ENV_VAR_LIST = std::vector<wxString>

Definition at line 31 of file env_vars.h.

Function Documentation

const ENV_VAR_LIST& GetPredefinedEnvVars ( )

Get the list of pre-defined environment variables.

Definition at line 59 of file env_vars.cpp.

References predefined_env_vars.

Referenced by DIALOG_CONFIGURE_PATHS::OnHelp().

60 {
61  return predefined_env_vars;
62 }
static const ENV_VAR_LIST predefined_env_vars
Definition: env_vars.cpp:35
bool IsEnvVarImmutable ( const wxString &  aEnvVar)

Determine if an environment variable is "predefined", i.e.

if the name of the variable is special to KiCad, and isn't just a user-specified substitution name.

Parameters
aEnvVarthe variable to check
Returns
true if predefined

Definition at line 47 of file env_vars.cpp.

References predefined_env_vars.

Referenced by DIALOG_CONFIGURE_PATHS::AppendEnvVar(), and DIALOG_CONFIGURE_PATHS::OnRemoveEnvVar().

48 {
49  for( const auto& s: predefined_env_vars )
50  {
51  if( s == aEnvVar )
52  return true;
53  }
54 
55  return false;
56 }
static const ENV_VAR_LIST predefined_env_vars
Definition: env_vars.cpp:35
wxString LookUpEnvVarHelp ( const wxString &  aEnvVar)

Look up long-form help text for a given environment variable.

This is intended for use in more verbose help resources (as opposed to tooltip text)

Parameters
aEnvVarThe variable to look up
Returns
A string with help for that variable. Empty if no help available for this variable.

Definition at line 97 of file env_vars.cpp.

References initialiseEnvVarHelp().

Referenced by DIALOG_CONFIGURE_PATHS::OnHelp().

98 {
99  static STRING_MAP env_var_help_text;
100 
101  if( env_var_help_text.size() == 0 )
102  initialiseEnvVarHelp( env_var_help_text );
103 
104  return env_var_help_text[aEnvVar];
105 }
std::map< wxString, wxString > STRING_MAP
Definition: env_vars.cpp:26
void initialiseEnvVarHelp(STRING_MAP &aMap)
Definition: env_vars.cpp:65