StringTemplate in QT or C++?
-
Hi,
I'm porting a java application that is using StringTemplate: https://theantlrguy.atlassian.net/wiki/spaces/ST/pages/1409116/Five+minute+Introduction
Basically it is loading a file that has some keywords that will be replaced. It is also able to iterate over some maps.
Any idea if there is a QT or C++ equivalent?
Cheers
PS: here is an example of the template file:$projectName$ $title$ some fixed property $myMap:{$it.myKey$ $it.myValue$}; separator={$newLine$}$
I'd just need to give the good strings for projectName, title and newLine and provide the map myMap
PS: I could parse the template file and replace the strings with all the values stored in a QMap, my problem would then be how to iterate the map when I'm only getting its name and the attribute's name (in fact it is not a map but a list of objects) as strings.
-
Thanks for the link.
I'd prefer something lighter. I may adapt something from cpptempl, removing the boost library. (http://ginstrom.com/scribbles/2010/10/30/cpptempl-a-template-language-for-c/comment-page-1/)