Added parent tag pointer throughout call hierarchy.Cleaned up output hierarchy parameter names.
This commit is contained in:
parent
7138e046e2
commit
ad48c530a0
55
Tag.cpp
55
Tag.cpp
@ -27,11 +27,11 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
Tag::Tag(coreutils::ZString &in, coreutils::MString &parent, Global &global, coreutils::ZString splitTagName)
|
Tag::Tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, coreutils::ZString splitTagName)
|
||||||
: ZString(in), parent(parent), global(global) {
|
: ZString(in), parentOut(parentOut), global(global), parent(parent) {
|
||||||
this->splitTagName = splitTagName;
|
this->splitTagName = splitTagName;
|
||||||
if(in.ifNext("<")) {
|
if(in.ifNext("<")) {
|
||||||
name = in.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_!");
|
name = in.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_!");
|
||||||
if(in.startsWith(" ") || in.startsWith("/") || in.startsWith(">")) {
|
if(in.startsWith(" ") || in.startsWith("/") || in.startsWith(">")) {
|
||||||
coreutils::Log(coreutils::LOG_DEBUG_1) << "Processing tag: " << name;
|
coreutils::Log(coreutils::LOG_DEBUG_1) << "Processing tag: " << name;
|
||||||
bool finished = false;
|
bool finished = false;
|
||||||
@ -100,11 +100,10 @@ namespace jet {
|
|||||||
|
|
||||||
Tag::~Tag() {
|
Tag::~Tag() {
|
||||||
if(evaluate)
|
if(evaluate)
|
||||||
if(output)
|
if(output)
|
||||||
copyContainer(out, parent);
|
copyContainer(out, parentOut);
|
||||||
else
|
else if(output)
|
||||||
if(output)
|
copyContainer(container, parentOut);
|
||||||
copyContainer(container, parent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tag::processContainer(coreutils::ZString &container, coreutils::ZString container2) {
|
void Tag::processContainer(coreutils::ZString &container, coreutils::ZString container2) {
|
||||||
@ -118,64 +117,64 @@ namespace jet {
|
|||||||
while(!in.eod()) {
|
while(!in.eod()) {
|
||||||
if(in.startsWith("<")) {
|
if(in.startsWith("<")) {
|
||||||
if(ifTagName(in, "mysql")) {
|
if(ifTagName(in, "mysql")) {
|
||||||
__mysql _mysql(in, out, global);
|
__mysql _mysql(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "comment")) {
|
} else if(ifTagName(in, "comment")) {
|
||||||
__comment _comment(in, out, global);
|
__comment _comment(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "sql")) {
|
} else if(ifTagName(in, "sql")) {
|
||||||
__sql _sql(in, out, global);
|
__sql _sql(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "whilerow")) {
|
} else if(ifTagName(in, "whilerow")) {
|
||||||
__whilerow _whilerow(in, out, global);
|
__whilerow _whilerow(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "for")) {
|
} else if(ifTagName(in, "for")) {
|
||||||
__for _for(in, out, global);
|
__for _for(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "if")) {
|
} else if(ifTagName(in, "if")) {
|
||||||
__if _if(in, out, global);
|
__if _if(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "ifrow")) {
|
} else if(ifTagName(in, "ifrow")) {
|
||||||
__ifrow _ifrow(in, out, global);
|
__ifrow _ifrow(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "include")) {
|
} else if(ifTagName(in, "include")) {
|
||||||
__include _include(in, out, global);
|
__include _include(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "jet")) {
|
} else if(ifTagName(in, "jet")) {
|
||||||
__jet _jet(in, out, global);
|
__jet _jet(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "read")) {
|
} else if(ifTagName(in, "read")) {
|
||||||
__read _read(in, out, global);
|
__read _read(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "write")) {
|
} else if(ifTagName(in, "write")) {
|
||||||
__write _write(in, out, global);
|
__write _write(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "set")) {
|
} else if(ifTagName(in, "set")) {
|
||||||
__set _set(in, out, global);
|
__set _set(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "call")) {
|
} else if(ifTagName(in, "call")) {
|
||||||
__call _call(in, out, global);
|
__call _call(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "system")) {
|
} else if(ifTagName(in, "system")) {
|
||||||
__system _system(in, out, global);
|
__system _system(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "while")) {
|
} else if(ifTagName(in, "while")) {
|
||||||
__while _while(in, out, global);
|
__while _while(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "header")) {
|
} else if(ifTagName(in, "header")) {
|
||||||
__header _header(in, out, global);
|
__header _header(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "whiledir")) {
|
} else if(ifTagName(in, "whiledir")) {
|
||||||
__whiledir _whiledir(in, out, global);
|
__whiledir _whiledir(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "stream")) {
|
} else if(ifTagName(in, "stream")) {
|
||||||
__stream _stream(in, out, global);
|
__stream _stream(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "tag")) {
|
} else if(ifTagName(in, "tag")) {
|
||||||
__tag _tag(in, out, global);
|
__tag _tag(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagDefined(in, tag)) {
|
} else if(ifTagDefined(in, tag)) {
|
||||||
__dotag _dotag(in, out, global);
|
__dotag _dotag(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "container")) {
|
} else if(ifTagName(in, "container")) {
|
||||||
processContainer(container2);
|
processContainer(container2);
|
||||||
|
5
Tag.h
5
Tag.h
@ -11,7 +11,7 @@ namespace jet {
|
|||||||
class Tag : public coreutils::ZString {
|
class Tag : public coreutils::ZString {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Tag(coreutils::ZString &in, coreutils::MString &parent, Global &global, coreutils::ZString splitTagName = "");
|
Tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, coreutils::ZString splitTagName = "");
|
||||||
virtual ~Tag();
|
virtual ~Tag();
|
||||||
coreutils::ZString name;
|
coreutils::ZString name;
|
||||||
coreutils::ZString container;
|
coreutils::ZString container;
|
||||||
@ -27,8 +27,9 @@ namespace jet {
|
|||||||
void copyContainer(coreutils::ZString &in, coreutils::MString &out);
|
void copyContainer(coreutils::ZString &in, coreutils::MString &out);
|
||||||
|
|
||||||
Global &global;
|
Global &global;
|
||||||
coreutils::MString &parent;
|
Tag *parent;
|
||||||
|
|
||||||
|
coreutils::MString &parentOut;
|
||||||
coreutils::MString out;
|
coreutils::MString out;
|
||||||
|
|
||||||
bool output = true;
|
bool output = true;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__call::__call(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) {
|
__call::__call(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
if(hasContainer)
|
if(hasContainer)
|
||||||
throw coreutils::Exception("call tag cannot have a container.");
|
throw coreutils::Exception("call tag cannot have a container.");
|
||||||
if(!variableDefined("pgm"))
|
if(!variableDefined("pgm"))
|
||||||
|
2
__call.h
2
__call.h
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __call : public Tag {
|
class __call : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__call(coreutils::ZString &in, coreutils::MString &out, Global &global);
|
__call(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int pid;
|
int pid;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__comment::__comment(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) {
|
__comment::__comment(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
if(!hasContainer)
|
if(!hasContainer)
|
||||||
throw coreutils::Exception("comment must have a container.");
|
throw coreutils::Exception("comment must have a container.");
|
||||||
output = false;
|
output = false;
|
||||||
|
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __comment : public Tag {
|
class __comment : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__comment(coreutils::ZString &in, coreutils::MString &out, Global &global);
|
__comment(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__dotag::__dotag(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
__dotag::__dotag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
hasContainer = true;
|
hasContainer = true;
|
||||||
coreutils::ZString container3 = global.tags[name];
|
coreutils::ZString container3 = global.tags[name];
|
||||||
processContainer(container3, container);
|
processContainer(container3, container);
|
||||||
|
@ -9,7 +9,7 @@ namespace jet {
|
|||||||
class __dotag : public Tag {
|
class __dotag : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__dotag(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__dotag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__for::__for(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) {
|
__for::__for(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
double counter = 0.0f;
|
double counter = 0.0f;
|
||||||
double end = 0.0f;
|
double end = 0.0f;
|
||||||
double step = 0.0f;
|
double step = 0.0f;
|
||||||
|
2
__for.h
2
__for.h
@ -9,7 +9,7 @@ namespace jet {
|
|||||||
class __for : public Tag {
|
class __for : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__for(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__for(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__header::__header(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
__header::__header(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
output = false;
|
output = false;
|
||||||
if(!variableDefined("name"))
|
if(!variableDefined("name"))
|
||||||
throw coreutils::Exception("header tag must have name defined.");
|
throw coreutils::Exception("header tag must have name defined.");
|
||||||
|
@ -11,7 +11,7 @@ namespace jet {
|
|||||||
class __header : public Tag {
|
class __header : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__header(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__header(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
2
__if.cpp
2
__if.cpp
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__if::__if(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global, "else") {
|
__if::__if(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, "else") {
|
||||||
|
|
||||||
coreutils::MString result;
|
coreutils::MString result;
|
||||||
bool booleanResult = false;
|
bool booleanResult = false;
|
||||||
|
2
__if.h
2
__if.h
@ -11,7 +11,7 @@ namespace jet {
|
|||||||
class __if : public Tag {
|
class __if : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__if(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__if(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__ifrow::__ifrow(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global, "else") {
|
__ifrow::__ifrow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, "else") {
|
||||||
output = false;
|
output = false;
|
||||||
if(!hasContainer)
|
if(!hasContainer)
|
||||||
throw coreutils::Exception("ifrow tag must have a container.");
|
throw coreutils::Exception("ifrow tag must have a container.");
|
||||||
|
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __ifrow : public Tag {
|
class __ifrow : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__ifrow(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__ifrow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__include::__include(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) {
|
__include::__include(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
if(!variableDefined("file"))
|
if(!variableDefined("file"))
|
||||||
throw coreutils::Exception("file keyword must be specified.");
|
throw coreutils::Exception("file keyword must be specified.");
|
||||||
if(hasContainer)
|
if(hasContainer)
|
||||||
|
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __include : public Tag {
|
class __include : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__include(coreutils::ZString &in, coreutils::MString &out, Global &global);
|
__include(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__jet::__jet(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
__jet::__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
if(variables["cgi"] == "true") {
|
if(variables["cgi"] == "true") {
|
||||||
coreutils::ZString requestMethod(getenv("REQUEST_METHOD"));
|
coreutils::ZString requestMethod(getenv("REQUEST_METHOD"));
|
||||||
if(requestMethod == "POST") {
|
if(requestMethod == "POST") {
|
||||||
|
2
__jet.h
2
__jet.h
@ -10,7 +10,7 @@ namespace jet {
|
|||||||
class __jet : public Tag {
|
class __jet : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__jet(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__mysql::__mysql(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
__mysql::__mysql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
|
|
||||||
if(!variableDefined("host"))
|
if(!variableDefined("host"))
|
||||||
throw coreutils::Exception("host must be specified for mysql tag.");
|
throw coreutils::Exception("host must be specified for mysql tag.");
|
||||||
|
@ -12,7 +12,7 @@ namespace jet {
|
|||||||
class __mysql : public Tag {
|
class __mysql : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__mysql(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__mysql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
~__mysql();
|
~__mysql();
|
||||||
|
|
||||||
void query(coreutils::MString query);
|
void query(coreutils::MString query);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__read::__read(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
__read::__read(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
if(!variableDefined("file"))
|
if(!variableDefined("file"))
|
||||||
throw coreutils::Exception("file keyword must be specified.");
|
throw coreutils::Exception("file keyword must be specified.");
|
||||||
if(!variableDefined("name"))
|
if(!variableDefined("name"))
|
||||||
|
2
__read.h
2
__read.h
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __read : public Tag {
|
class __read : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__read(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__read(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int fd;
|
int fd;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__set::__set(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
__set::__set(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
output = false;
|
output = false;
|
||||||
if(!variableDefined("name"))
|
if(!variableDefined("name"))
|
||||||
throw coreutils::Exception("set tag must have name defined.");
|
throw coreutils::Exception("set tag must have name defined.");
|
||||||
|
2
__set.h
2
__set.h
@ -11,7 +11,7 @@ namespace jet {
|
|||||||
class __set : public Tag {
|
class __set : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__set(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__set(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__sql::__sql(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
__sql::__sql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
output = false;
|
output = false;
|
||||||
if(!hasContainer)
|
if(!hasContainer)
|
||||||
throw coreutils::Exception("sql tag must have a container.");
|
throw coreutils::Exception("sql tag must have a container.");
|
||||||
|
2
__sql.h
2
__sql.h
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __sql : public Tag {
|
class __sql : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__sql(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__sql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__stream::__stream(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
__stream::__stream(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
if(!variableDefined("name"))
|
if(!variableDefined("name"))
|
||||||
throw coreutils::Exception("stream tag must have a file name to stream.");
|
throw coreutils::Exception("stream tag must have a file name to stream.");
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ namespace jet {
|
|||||||
class __stream : public Tag {
|
class __stream : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__stream(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__stream(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__system::__system(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) {
|
__system::__system(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
if(hasContainer)
|
if(hasContainer)
|
||||||
throw coreutils::Exception("system tag cannot have a container.");
|
throw coreutils::Exception("system tag cannot have a container.");
|
||||||
if(!variableDefined(coreutils::ZString("pgm")))
|
if(!variableDefined(coreutils::ZString("pgm")))
|
||||||
|
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __system : public Tag {
|
class __system : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__system(coreutils::ZString &in, coreutils::MString &out, Global &global);
|
__system(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int pid;
|
int pid;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__tag::__tag(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
__tag::__tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
evaluate = false;
|
evaluate = false;
|
||||||
output = false;
|
output = false;
|
||||||
if(!variableDefined("name"))
|
if(!variableDefined("name"))
|
||||||
|
2
__tag.h
2
__tag.h
@ -9,7 +9,7 @@ namespace jet {
|
|||||||
class __tag : public Tag {
|
class __tag : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__tag(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__while::__while(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) {
|
__while::__while(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
|
|
||||||
if(variableDefined(coreutils::ZString("value1"))) {
|
if(variableDefined(coreutils::ZString("value1"))) {
|
||||||
if(variableDefined(coreutils::ZString("expr")))
|
if(variableDefined(coreutils::ZString("expr")))
|
||||||
|
@ -9,7 +9,7 @@ namespace jet {
|
|||||||
class __while : public Tag {
|
class __while : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__while(coreutils::ZString &in, coreutils::MString &out, Global &global);
|
__while(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__whiledir::__whiledir(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
__whiledir::__whiledir(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
if(!variableDefined("path"))
|
if(!variableDefined("path"))
|
||||||
throw coreutils::Exception("whiledir tag must specify a path.");
|
throw coreutils::Exception("whiledir tag must specify a path.");
|
||||||
if(variableDefined("sort") && (variables["sort"] == "true")) {
|
if(variableDefined("sort") && (variables["sort"] == "true")) {
|
||||||
|
@ -10,7 +10,7 @@ namespace jet {
|
|||||||
class __whiledir : public Tag {
|
class __whiledir : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__whiledir(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__whiledir(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__whilerow::__whilerow(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
__whilerow::__whilerow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
|
|
||||||
int count = variables["count"].asInteger();
|
int count = variables["count"].asInteger();
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ namespace jet {
|
|||||||
class __whilerow : public Tag {
|
class __whilerow : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__whilerow(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__whilerow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__write::__write(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
__write::__write(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||||
output = false;
|
output = false;
|
||||||
int mode = 0;
|
int mode = 0;
|
||||||
int len;
|
int len;
|
||||||
|
@ -11,7 +11,7 @@ namespace jet {
|
|||||||
class __write : public Tag {
|
class __write : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__write(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
__write(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ int main(int argc, char **argv) {
|
|||||||
jet::Global global;
|
jet::Global global;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
coreutils::MString out;
|
coreutils::MString out;
|
||||||
jet::__jet *jet = new jet::__jet(data, out, global);
|
jet::__jet *jet = new jet::__jet(data, out, global, NULL);
|
||||||
delete jet;
|
delete jet;
|
||||||
global.outputHeaders();
|
global.outputHeaders();
|
||||||
std::cout << out;
|
std::cout << out;
|
||||||
|
9
testdb.jet
Executable file
9
testdb.jet
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!./jet-2.0
|
||||||
|
<jet cgi="true" name1="localname" filterblanklines="true" trimlines="true">
|
||||||
|
<mysql host="localhost" database="barant" user="barant" password="uversa" sessionid="1">
|
||||||
|
<sql sessionid="1">select * from testdata</sql>
|
||||||
|
<whilerow name="index" count="10" sessionid="1">
|
||||||
|
$[1.id] $[1.text] $[1.value]
|
||||||
|
</whilerow>
|
||||||
|
</mysql>
|
||||||
|
</jet>
|
6
testfor.jet
Executable file
6
testfor.jet
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!./jet-2.0
|
||||||
|
<jet cgi="true" name1="localname" filterblanklines="true" trimlines="true">
|
||||||
|
<for name="ix" start="1" end="5" step="1">
|
||||||
|
-->#[ix]<--
|
||||||
|
</for>
|
||||||
|
</jet>
|
@ -11,12 +11,6 @@
|
|||||||
---
|
---
|
||||||
$[nonexistant]
|
$[nonexistant]
|
||||||
$[%HOME]
|
$[%HOME]
|
||||||
<mysql host="localhost" database="barant" user="barant" password="uversa" sessionid="1">
|
|
||||||
<sql sessionid="1">select * from testdata</sql>
|
|
||||||
<whilerow name="index" count="10" sessionid="1">
|
|
||||||
$[1.id] $[1.text] $[1.value]
|
|
||||||
</whilerow>
|
|
||||||
</mysql>
|
|
||||||
<set name="ix" value="1" />
|
<set name="ix" value="1" />
|
||||||
<set name="theexpr" expr="SUBSTRING('abcdefg', 5 - 4, 20 - 17)" />
|
<set name="theexpr" expr="SUBSTRING('abcdefg', 5 - 4, 20 - 17)" />
|
||||||
<set name="addition" expr="5+3" />
|
<set name="addition" expr="5+3" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user