My Project

Loading...
Searching...
No Matches
Tag.h
1#ifndef __Tag_h__
2#define __Tag_h__
3
4#include "ZString.h"
5#include "MString.h"
6#include "Global.h"
7#include <map>
8
12
13 namespace jet {
14
18
19 class Tag : public coreutils::ZString {
20
21 public:
22 Tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent = NULL, Tag *local = NULL, coreutils::ZString splitTagName = "");
23 virtual ~Tag();
24
25 coreutils::MString getVariable(coreutils::ZString &variable, bool inContainer = false);
26
27 coreutils::MString resolveKeyword(coreutils::ZString keyword);
28 std::map<coreutils::MString, coreutils::MString> variables;
29 std::map<coreutils::MString, coreutils::MString> keywords;
30 coreutils::ZString name;
31 coreutils::ZString container;
32 coreutils::ZString container2;
33 Global &global;
34 Tag *parent;
35 Tag *local;
36
37 protected:
38 bool hasContainer = false;
39 bool hasContainer2 = false;
40 bool keywordDefined(coreutils::ZString variable);
41 void parseContainer(coreutils::ZString &in, coreutils::MString &out, coreutils::ZString container2 = NULL, bool topLevel = false);
42 void processContainer(coreutils::ZString &container, coreutils::ZString container2 = NULL, bool topLevel = false);
43 void copyContainer(coreutils::ZString &in, coreutils::MString &out);
44
45 coreutils::MString &parentOut;
46 coreutils::MString out;
47
48 bool output = true;
49 bool evaluate = true;
50 bool filterBlankLines = false;
51 bool trimLines = false;
52 bool cleanWhitespace = false;
53
54 void renderVariableName(coreutils::ZString &variable, coreutils::MString &name, coreutils::MString &modifier);
55 void storeVariable(coreutils::ZString variable, coreutils::MString value, coreutils::ZString scope);
56 void storeVariable(coreutils::ZString variable);
57
58 private:
59 bool containerOnly = false;
60 coreutils::ZString splitTagName;
61
62 int skipBlankLine(coreutils::ZString in);
63
64 void scanContainer(coreutils::ZString &in);
65 bool ifNested(coreutils::ZString &in);
66 bool ifTagName(coreutils::ZString &in, const char *tag);
67 bool ifTagName(coreutils::ZString &in);
68 bool ifTagDefined(coreutils::ZString &in, coreutils::ZString &tag);
69 bool ifEndTagName(coreutils::ZString &in);
70 bool ifSplitTagName(coreutils::ZString &in);
71
72 coreutils::MString processModifier(coreutils::MString &value, coreutils::MString &modifier);
73 };
74
75}
76
77#endif
jet::Global
Definition Global.h:12
jet::Tag
Definition Tag.h:19
jet::Tag::resolveKeyword
coreutils::MString resolveKeyword(coreutils::ZString keyword)
>retrieve a vairable value from a text string cotontaining a variable name.
Definition Tag.cpp:114
jet::Tag::~Tag
virtual ~Tag()
>Constructor
Definition Tag.cpp:106