converted FileIO to c++ class