Almost done with tag tag.
This commit is contained in:
parent
8499199592
commit
c1e003e552
1
.#JetCore.txt
Symbolic link
1
.#JetCore.txt
Symbolic link
@ -0,0 +1 @@
|
||||
barant@barant01.5084
|
1
Global.h
1
Global.h
@ -28,6 +28,7 @@ namespace jet {
|
||||
std::map<coreutils::MString, coreutils::MString> cgiVariables;
|
||||
std::map<coreutils::MString, __mysql *> sessions;
|
||||
std::map<coreutils::MString, coreutils::MString> headers;
|
||||
std::map<coreutils::MString, coreutils::MString> tags;
|
||||
|
||||
};
|
||||
|
||||
|
10
Tag.cpp
10
Tag.cpp
@ -1,6 +1,7 @@
|
||||
#include "Tag.h"
|
||||
#include "Exception.h"
|
||||
#include "KeywordValue.h"
|
||||
#include "Global.h"
|
||||
#include "Log.h"
|
||||
#include "__mysql.h"
|
||||
#include "__sql.h"
|
||||
@ -19,6 +20,7 @@
|
||||
#include "__while.h"
|
||||
#include "__header.h"
|
||||
#include "__whiledir.h"
|
||||
#include "__tag.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace jet {
|
||||
@ -163,6 +165,12 @@ namespace jet {
|
||||
} else if(ifTagName(in, "whiledir")) {
|
||||
__whiledir _whiledir(in, out, global);
|
||||
continue;
|
||||
} else if(ifTagName(in, "tag")) {
|
||||
__tag _tag(in, out, global);
|
||||
continue;
|
||||
} else if(tags.contains(in)) {
|
||||
__tag _tag(in, out, global);
|
||||
continue;
|
||||
} else {
|
||||
out.write(in.charAt(0));
|
||||
in.nextChar();
|
||||
@ -175,7 +183,7 @@ namespace jet {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Tag::scanContainer(coreutils::ZString &in) {
|
||||
while(!in.eod()) {
|
||||
if(ifEndTagName(in))
|
||||
|
14
__tag.cpp
Normal file
14
__tag.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include "__tag.h"
|
||||
#include "Exception.h"
|
||||
|
||||
namespace jet {
|
||||
|
||||
__tag::__tag(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
||||
if(!variableDefined("name"))
|
||||
throw coreutils::Exception("tag must have a name.");
|
||||
if(!hasContainer)
|
||||
throw coreutils::Exception("tag requires a container to process.");
|
||||
global.tags[variables["name"]] = container;
|
||||
}
|
||||
}
|
||||
|
18
__tag.h
Normal file
18
__tag.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef ____tag_h__
|
||||
#define ____tag_h__
|
||||
|
||||
#include "Tag.h"
|
||||
#include "ZString.h"
|
||||
|
||||
namespace jet {
|
||||
|
||||
class __tag : public Tag {
|
||||
|
||||
public:
|
||||
__tag(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -11,13 +11,12 @@
|
||||
---
|
||||
$[nonexistant]
|
||||
$[%HOME]
|
||||
<comment>
|
||||
<mysql host="barant.com" database="barant" user="barant" password="uversa1960" sessionid="1">
|
||||
<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>
|
||||
</comment>
|
||||
</mysql>
|
||||
<set name="ix" value="1" />
|
||||
<set name="theexpr" expr="SUBSTRING('abcdefg', 5 - 4, 20 - 17)" />
|
||||
<set name="addition" expr="5+3" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user