diff options
author | deva <deva> | 2011-07-01 11:54:26 +0000 |
---|---|---|
committer | deva <deva> | 2011-07-01 11:54:26 +0000 |
commit | 23f39df8b8edeacfa5821050abbdc855acb2edd6 (patch) | |
tree | e56f7826c361a85a3bac9e0b3206086c81114748 /server/src/transactionparser.cc | |
parent | 2c53b5ef16626112dfc738420eec3e1963b1a343 (diff) |
removed macrotool.
add lua wrapper for praxisd.
new type attributes_t for sax parser and children.
make macros/templates use real vars instead of var map.
add data ttl on macro level.
add 'important' attribute to macrotags in templates.
Diffstat (limited to 'server/src/transactionparser.cc')
-rw-r--r-- | server/src/transactionparser.cc | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/server/src/transactionparser.cc b/server/src/transactionparser.cc index f78e562..142b95f 100644 --- a/server/src/transactionparser.cc +++ b/server/src/transactionparser.cc @@ -43,29 +43,28 @@ TransactionParser::TransactionParser(Transaction *transaction) totalbytes = 0; } -void TransactionParser::startTag(std::string name, - std::map<std::string, std::string> attributes) +void TransactionParser::startTag(std::string name, attributes_t &attr) { DEBUG(transactionparser, "<%s>\n", name.c_str()); if(name == "pracro") { - transaction->user = attributes["user"]; - transaction->cpr = attributes["cpr"]; - transaction->version = attributes["version"]; + transaction->user = attr["user"]; + transaction->cpr = attr["cpr"]; + transaction->version = attr["version"]; } if(name == "request") { Request r; - r.templ = attributes["template"]; - r.macro = attributes["macro"]; + r.templ = attr["template"]; + r.macro = attr["macro"]; transaction->requests.push_back(r); } if(name == "commit") { Commit c; - c.templ = attributes["template"]; - c.macro = attributes["macro"]; - c.version = attributes["version"]; + c.templ = attr["template"]; + c.macro = attr["macro"]; + c.version = attr["version"]; transaction->commits.push_back(c); } @@ -75,18 +74,17 @@ void TransactionParser::startTag(std::string name, throw std::exception(); } - if(attributes.find("name") == attributes.end()) { + if(attr.find("name") == attr.end()) { ERR(transactionparser, "Field is missing 'name' attribute"); throw std::exception(); } - if(attributes.find("value") == attributes.end()) { + if(attr.find("value") == attr.end()) { ERR(transactionparser, "Field is missing 'value' attribute"); throw std::exception(); } - transaction->commits.back().fields[attributes["name"]] = - attributes["value"]; + transaction->commits.back().fields[attr["name"]] = attr["value"]; } } |