views:

2958

answers:

6

I am looking for template/generator libraries for C++ that are similar to eg. Ruby's Erb, Haml, PHP's Smarty, etc.

It would be great if I it would sport some basic features like loops, if/else, int conversion to strings, etc.

Parameter passing to template rendering engine is also important if I could pass all of them in a hash map instead of calling some function for each of parameters.

Do you have any recommendations?

I can see also the possibility of embedding languages like Lua, however I haven't found a templatizing library for that either.

Thanks!

A: 

ClearSilver is available for c. Here is a list of existing websites which use clearsilver. But I don't use it myself.

Wimmel
A: 

You can give my library a whirl - it's very light, and the syntax and usage is elementary:

http://nulidex.com/code/docs/html_template/

Of course Google has one that they use for google.com, but their syntax is not compatible with Perl's HTML::Template :)

+5  A: 

So, the current list is:

Marcin Gil
+2  A: 

Wt (pronounced 'witty') is a C++ library and application server for developing and deploying web applications. It is not a 'framework', which enforces a way of programming, but a library.

yesraaj
Worth remembering, however I was looking on how to embed HTML templatizing functionality into a C++ desktop program.
Marcin Gil
+2  A: 

CTPP is very fast and powerful library written in C++. It has bindings for Perl, PHP and Python.

A: 

Grantlee is a string template engine based on the Django template system. It is ported to C++/Qt.

Kristian