Implemented __ifrow tag.

This commit is contained in:
Brad Arant 2024-10-14 08:28:24 -07:00
parent 7d6bb8355f
commit f1624b074a
4 changed files with 41 additions and 0 deletions

View File

@ -8,6 +8,7 @@
#include "__comment.h" #include "__comment.h"
#include "__for.h" #include "__for.h"
#include "__if.h" #include "__if.h"
#include "__ifrow.h"
#include "__read.h" #include "__read.h"
#include "__write.h" #include "__write.h"
#include "__set.h" #include "__set.h"
@ -127,6 +128,9 @@ namespace jet {
} else if(ifTagName(in, "if")) { } else if(ifTagName(in, "if")) {
__if _if(in, out, global); __if _if(in, out, global);
continue; continue;
} else if(ifTagName(in, "ifrow")) {
__ifrow _ifrow(in, out, global);
continue;
} else if(ifTagName(in, "jet")) { } else if(ifTagName(in, "jet")) {
__jet _jet(in, out, global); __jet _jet(in, out, global);
continue; continue;

20
__ifrow.cpp Normal file
View File

@ -0,0 +1,20 @@
#include "__ifrow.h"
#include "Exception.h"
#include "MString.h"
#include "__mysql.h"
#include <stdlib.h>
#include <unistd.h>
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);
}
}

17
__ifrow.h Normal file
View File

@ -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

BIN
jet-2.0

Binary file not shown.