Created $[$name] retrieve for environment variables.
This commit is contained in:
parent
fa711ddf86
commit
7d6bb8355f
@ -2,6 +2,7 @@
|
||||
#include "Exception.h"
|
||||
#include "__mysql.h"
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace jet {
|
||||
|
||||
@ -45,6 +46,8 @@ namespace jet {
|
||||
// TODO: should only allow CGI variable name. Allow variable substitution.
|
||||
} if(variable.ifNext("@")) {
|
||||
// TODO: should only allow environment variables. Allow substitution.
|
||||
} if(variable.ifNext("$")) {
|
||||
return getenv(renderVariableName(name, variable).c_str());
|
||||
} else {
|
||||
coreutils::MString splitName = renderVariableName(name, variable);
|
||||
splitName.split(".");
|
||||
|
@ -4,13 +4,13 @@
|
||||
<comment>This is a comment and should not show up in the output.</comment>
|
||||
<html>
|
||||
$[nonexistant]
|
||||
$[$HOME]
|
||||
<comment>
|
||||
<mysql host="localhost" database="barant" user="barant" password="uversa" sessionid="1">
|
||||
<mysql host="barant.com" database="barant" user="barant" password="uversa1960" sessionid="1">
|
||||
<sql sessionid="1">select * from testdata</sql>
|
||||
<whilerow name="index" count="10" sessionid="1">
|
||||
$[1.id] $[1.text] $[1.value]
|
||||
</whilerow>
|
||||
</mysql>
|
||||
</comment>
|
||||
<set name="ix" value="1" />
|
||||
<set name="theexpr" expr="SUBSTRING('abcdefg', 5 - 4, 20 - 17)" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user