#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 &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, this, "else") {
      output = false;
      if(!hasContainer)
	throw coreutils::Exception("ifrow tag must have a container.");	
      if(!global.sessionExists(keywords[resolveKeyword("sessionid")]))
	throw coreutils::Exception("sessionid does not exist.");
      if(global.getSession(keywords[resolveKeyword("sessionid")])->hasRow()) 
	processContainer(container);
      else
	processContainer(container2);
   }
   
}
