diff --git a/Tag.cpp b/Tag.cpp index c1a23ed..7e126ad 100644 --- a/Tag.cpp +++ b/Tag.cpp @@ -8,6 +8,7 @@ #include "__comment.h" #include "__for.h" #include "__if.h" +#include "__ifrow.h" #include "__read.h" #include "__write.h" #include "__set.h" @@ -127,6 +128,9 @@ namespace jet { } else if(ifTagName(in, "if")) { __if _if(in, out, global); continue; + } else if(ifTagName(in, "ifrow")) { + __ifrow _ifrow(in, out, global); + continue; } else if(ifTagName(in, "jet")) { __jet _jet(in, out, global); continue; diff --git a/__ifrow.cpp b/__ifrow.cpp new file mode 100644 index 0000000..93ef607 --- /dev/null +++ b/__ifrow.cpp @@ -0,0 +1,20 @@ +#include "__ifrow.h" +#include "Exception.h" +#include "MString.h" +#include "__mysql.h" +#include +#include + +namespace jet { + + __ifrow::__ifrow(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { + output = false; + if(!hasContainer) + throw coreutils::Exception("ifrow tag must have a container."); + if(!global.sessionExists(variables["sessionid"])) + throw coreutils::Exception("sessionid does not exist."); + if(global.getSession(variables["sessionid"])->hasRow()) + processContainer(container); + } + +} diff --git a/__ifrow.h b/__ifrow.h new file mode 100644 index 0000000..c89027c --- /dev/null +++ b/__ifrow.h @@ -0,0 +1,17 @@ +#ifndef ____ifrow_h__ +#define ____ifrow_h__ + +#include "Tag.h" + +namespace jet { + + class __ifrow : public Tag { + + public: + __ifrow(coreutils::ZString &in, coreutils::MString &parent, Global &global); + + }; + +} + +#endif diff --git a/jet-2.0 b/jet-2.0 index 8ce0e9b..8ddace9 100755 Binary files a/jet-2.0 and b/jet-2.0 differ