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, coreutils::MString> cgiVariables;
|
||||||
std::map<coreutils::MString, __mysql *> sessions;
|
std::map<coreutils::MString, __mysql *> sessions;
|
||||||
std::map<coreutils::MString, coreutils::MString> headers;
|
std::map<coreutils::MString, coreutils::MString> headers;
|
||||||
|
std::map<coreutils::MString, coreutils::MString> tags;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
8
Tag.cpp
8
Tag.cpp
@ -1,6 +1,7 @@
|
|||||||
#include "Tag.h"
|
#include "Tag.h"
|
||||||
#include "Exception.h"
|
#include "Exception.h"
|
||||||
#include "KeywordValue.h"
|
#include "KeywordValue.h"
|
||||||
|
#include "Global.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "__mysql.h"
|
#include "__mysql.h"
|
||||||
#include "__sql.h"
|
#include "__sql.h"
|
||||||
@ -19,6 +20,7 @@
|
|||||||
#include "__while.h"
|
#include "__while.h"
|
||||||
#include "__header.h"
|
#include "__header.h"
|
||||||
#include "__whiledir.h"
|
#include "__whiledir.h"
|
||||||
|
#include "__tag.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
@ -163,6 +165,12 @@ namespace jet {
|
|||||||
} else if(ifTagName(in, "whiledir")) {
|
} else if(ifTagName(in, "whiledir")) {
|
||||||
__whiledir _whiledir(in, out, global);
|
__whiledir _whiledir(in, out, global);
|
||||||
continue;
|
continue;
|
||||||
|
} else if(ifTagName(in, "tag")) {
|
||||||
|
__tag _tag(in, out, global);
|
||||||
|
continue;
|
||||||
|
} else if(tags.contains(in)) {
|
||||||
|
__tag _tag(in, out, global);
|
||||||
|
continue;
|
||||||
} else {
|
} else {
|
||||||
out.write(in.charAt(0));
|
out.write(in.charAt(0));
|
||||||
in.nextChar();
|
in.nextChar();
|
||||||
|
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]
|
$[nonexistant]
|
||||||
$[%HOME]
|
$[%HOME]
|
||||||
<comment>
|
<mysql host="localhost" database="barant" user="barant" password="uversa" sessionid="1">
|
||||||
<mysql host="barant.com" database="barant" user="barant" password="uversa1960" sessionid="1">
|
|
||||||
<sql sessionid="1">select * from testdata</sql>
|
<sql sessionid="1">select * from testdata</sql>
|
||||||
<whilerow name="index" count="10" sessionid="1">
|
<whilerow name="index" count="10" sessionid="1">
|
||||||
$[1.id] $[1.text] $[1.value]
|
$[1.id] $[1.text] $[1.value]
|
||||||
</whilerow>
|
</whilerow>
|
||||||
</comment>
|
</mysql>
|
||||||
<set name="ix" value="1" />
|
<set name="ix" value="1" />
|
||||||
<set name="theexpr" expr="SUBSTRING('abcdefg', 5 - 4, 20 - 17)" />
|
<set name="theexpr" expr="SUBSTRING('abcdefg', 5 - 4, 20 - 17)" />
|
||||||
<set name="addition" expr="5+3" />
|
<set name="addition" expr="5+3" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user