generate file function in cpp file class