Initial coding of <include> tag. Hass issues.
This commit is contained in:
parent
12b3542231
commit
b837c38c2a
4
Tag.cpp
4
Tag.cpp
@ -9,6 +9,7 @@
|
|||||||
#include "__for.h"
|
#include "__for.h"
|
||||||
#include "__if.h"
|
#include "__if.h"
|
||||||
#include "__ifrow.h"
|
#include "__ifrow.h"
|
||||||
|
#include "__include.h"
|
||||||
#include "__read.h"
|
#include "__read.h"
|
||||||
#include "__write.h"
|
#include "__write.h"
|
||||||
#include "__set.h"
|
#include "__set.h"
|
||||||
@ -132,6 +133,9 @@ namespace jet {
|
|||||||
} else if(ifTagName(in, "ifrow")) {
|
} else if(ifTagName(in, "ifrow")) {
|
||||||
__ifrow _ifrow(in, out, global);
|
__ifrow _ifrow(in, out, global);
|
||||||
continue;
|
continue;
|
||||||
|
} else if(ifTagName(in, "include")) {
|
||||||
|
__include _include(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;
|
||||||
|
17
__include.cpp
Normal file
17
__include.cpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#include "__include.h"
|
||||||
|
#include "Exception.h"
|
||||||
|
#include "File.h"
|
||||||
|
|
||||||
|
namespace jet {
|
||||||
|
|
||||||
|
__include::__include(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) {
|
||||||
|
if(!variableDefined("file"))
|
||||||
|
throw coreutils::Exception("file keyword must be specified.");
|
||||||
|
if(hasContainer)
|
||||||
|
throw coreutils::Exception("include tag should not have a container.");
|
||||||
|
coreutils::File file(file);
|
||||||
|
container = file.asZString();
|
||||||
|
processContainer(container);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
17
__include.h
Normal file
17
__include.h
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#ifndef ____include_h__
|
||||||
|
#define ____include_h__
|
||||||
|
|
||||||
|
#include "Tag.h"
|
||||||
|
|
||||||
|
namespace jet {
|
||||||
|
|
||||||
|
class __include : public Tag {
|
||||||
|
|
||||||
|
public:
|
||||||
|
__include(coreutils::ZString &in, coreutils::MString &out, Global &global);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
2
testinclude.jet
Normal file
2
testinclude.jet
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
This is from an include tag.
|
||||||
|
<set name="include" value="yes" />
|
@ -39,6 +39,8 @@
|
|||||||
<set name="noeval" eval="no">this is the value store in #[name].</set>
|
<set name="noeval" eval="no">this is the value store in #[name].</set>
|
||||||
<set name="thename" eval="yes">this is the value store in #[name].</set>
|
<set name="thename" eval="yes">this is the value store in #[name].</set>
|
||||||
<set name="newname" scope="global">another container value</set>
|
<set name="newname" scope="global">another container value</set>
|
||||||
|
<xinclude file="./testinclude.jet" />
|
||||||
|
include: $[include]
|
||||||
>>>$[noeval]<<<
|
>>>$[noeval]<<<
|
||||||
>>>$[thename]<<<
|
>>>$[thename]<<<
|
||||||
<set name="iz" value="data" />
|
<set name="iz" value="data" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user