Implemented __ifrow tag.
This commit is contained in:
parent
7d6bb8355f
commit
f1624b074a
4
Tag.cpp
4
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;
|
||||
|
20
__ifrow.cpp
Normal file
20
__ifrow.cpp
Normal 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
17
__ifrow.h
Normal 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
|
Loading…
x
Reference in New Issue
Block a user