Use fstream instead of C-style FILE *

Signed-off-by: Thorben Hasenpusch <thorben.hasenpusch@gmail.com>