A generic C++ file IO class