Difference between revisions of "Environment Variables plugin"

From Code::Blocks
(updated version to 0.91)
(Add scripting documentation)
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
* Name: Environment Variables Editor
+
[[Category:Code::Blocks Contrib Plugins]]
* Author: MortenMacFly
+
{{Infobox_Plugin|
* Purpose: A plugin for Code::Blocks that allows setting environment variables in the focus of Code::Blocks.
+
  name = Environment Variables Editor |
* Version: 0.91; State: alpha - '''beta''' - stable
+
  logo = [[File:Envvars.png]] |
* Last update: 08. May. 2006
+
  developer = [[User:MortenMacFly|MortenMacFly]] |
* Forum thread for discussion: [[/index.php?topic=3061.0]]
+
  maintainer = MortenMacFly |
* Link for download: [[/index.php?action=dlattach;topic=3061.0;attach=922]]
+
  version = 0.97
* Notes: Please have a look in the forum before using this plugin. Any support is welcome.
+
}}
<BR>
+
 
...back to [[Announcement for plugins/patches]]
+
'''Environment variables editor''' plugin allows for the setting of system environment variables in the focus of Code::Blocks. A user can have several sets that contain 1..n environment variables. A user can switch between these sets within the environment variables configuration dialog. In addition the EnvVars plugin offers an option to projects (within project setup) to apply a certain EnvVar set to activate (and use during compilation).
 +
 
 +
The dialog for editing the sets is located in Settings->Environment->Environment variables.<br/>
 +
The dialog for choosing the active set for the current project is located in Project->Properties->EnvVar options.
 +
 
 +
==Script binding==
 +
This plugin provides its functionality through a squirrel binding:
 +
{| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;"
 +
|- style="background: #ececec; border: 0px solid gray"
 +
!Return value
 +
!Name
 +
!Arguments
 +
!Remarks
 +
|-
 +
 
 +
|-
 +
| wxArrayString|| EnvvarGetEnvvarSetNames|| || Returns all envvars sets available
 +
|-
 +
 
 +
|-
 +
| wxString|| EnvvarGetActiveSetName||  ||  Returns the name of the currently active set (from config, /active_set)
 +
|-
 +
 
 +
|-
 +
| wxArrayString|| EnvVarGetEnvvarsBySetPath|| const wxString set_name ||  Returns the envvars of an envvars set path in the config
 +
|-
 +
 
 +
|-
 +
| bool|| EnvvarSetExists|| const wxString set_name || Verifies if an envvars set really exists in the config
 +
|-
 +
 
 +
|-
 +
| bool|| EnvvarSetApply|| const wxString& set_name, bool even_if_active || Applies a specific envvar set from the config (without UI interaction)
 +
|-
 +
 
 +
|-
 +
| void || EnvvarSetDiscard|| const wxString || Discards a specific envvar set from the config (without UI interaction)
 +
|-
 +
 
 +
|-
 +
| bool|| EnvvarApply|| const wxString key, const wxString value||  Applies a specific envvar
 +
|-
 +
 
 +
|-
 +
| bool|| EnvvarDiscard|| const wxString key|| Discards an envvar
 +
|-
 +
 
 +
|}
 +
 
 +
'''NOTE:''' The value arguments are automatically expanded from macros. You do not have to call <code>ReplaceMacros()</code> on them
 +
 
 +
=== Example ===
 +
On windows in the post or pre build steps:
 +
 
 +
<source lang="c">
 +
[[EnvvarApply(_("test"),_("testValue"));]]
 +
echo %test%
 +
</source>
 +
 
 +
==See also==
 +
* [[Code::Blocks variable types synthesis]]

Latest revision as of 20:06, 16 September 2019

Environment Variables Editor
Envvars.png
Developer(s): MortenMacFly
Maintainer(s): MortenMacFly
Version: 0.97

Environment variables editor plugin allows for the setting of system environment variables in the focus of Code::Blocks. A user can have several sets that contain 1..n environment variables. A user can switch between these sets within the environment variables configuration dialog. In addition the EnvVars plugin offers an option to projects (within project setup) to apply a certain EnvVar set to activate (and use during compilation).

The dialog for editing the sets is located in Settings->Environment->Environment variables.
The dialog for choosing the active set for the current project is located in Project->Properties->EnvVar options.

Script binding

This plugin provides its functionality through a squirrel binding:

Return value Name Arguments Remarks
wxArrayString EnvvarGetEnvvarSetNames Returns all envvars sets available
wxString EnvvarGetActiveSetName Returns the name of the currently active set (from config, /active_set)
wxArrayString EnvVarGetEnvvarsBySetPath const wxString set_name Returns the envvars of an envvars set path in the config
bool EnvvarSetExists const wxString set_name Verifies if an envvars set really exists in the config
bool EnvvarSetApply const wxString& set_name, bool even_if_active Applies a specific envvar set from the config (without UI interaction)
void EnvvarSetDiscard const wxString Discards a specific envvar set from the config (without UI interaction)
bool EnvvarApply const wxString key, const wxString value Applies a specific envvar
bool EnvvarDiscard const wxString key Discards an envvar

NOTE: The value arguments are automatically expanded from macros. You do not have to call ReplaceMacros() on them

Example

On windows in the post or pre build steps:

[[EnvvarApply(_("test"),_("testValue"));]]
echo %test%

See also