&quot;There is no API to pass a filename&quot;<p>Use:<p>convertToString(filename, sourceStr);<p>and pass sourceStr.<p>You are right about how much boilerplate there is - though you can hide it a bit with helper fns and a few macros.