Tuesday, March 04, 2008

Simple Templater in C++

Like I mentioned before, I'm posting some of my personal code library that I've accumulated over the years. If you modify or improve this, send the changes back please.

Recursive template engine with escaping and lazy evaluation. Note that it is case SENSITIVE.

Use
1. Add items to Templater's map.
templater.map()["bob"] = "joe";

2. Evaluate a text item that references a map item.
s = templater.eval("well, hello [!bob]");
Returns "well, hello joe" in s;

Code
templater.h
evaluator.h
evaluator.cpp

2 comments:

Unknown said...

templater.h and evaluator.cpp are currently inaccessible.

Paul Senzee said...

Thanks for the heads up. I fixed the links, they work now. ;)

Thank you!