i wrote a Grantlee alternative in 100 LOC...

Lubomir I. Ivanov neolit123 at gmail.com
Wed Oct 28 06:59:15 PDT 2015


...for fun.

not much to prove here other than what we need for the printing
templates is quite simple and Grantlee is an overkill.

unfortunately, it's already tightly integrated in the source tree as
Gehad did well implementing it.
i have no plans to change that anytime soon.

a couple of years ago i suggested to write a simple parser for HTML
input with variable replacement (i was planning C, even), but i didn't
have a good idea how to approach the printing templates business.
instead, Tomaz suggested Grantlee and we agreed it's the way to go.

here is the Qt version of such a POC parser that uses QHash and QString.

- fast, can be even faster
- no meta compilers
- direct control of which variables are special (e.g. the dive notes support LF)
- direct control of template loading

sometimes reinventing the wheel makes life easier. ;-)

lubomir
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parser.png
Type: image/png
Size: 30570 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20151028/8d0ee4be/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parser.zip
Type: application/zip
Size: 8732 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20151028/8d0ee4be/attachment-0001.zip>


More information about the subsurface mailing list