add C++ output mode (output and enum in the header file and a .cpp file)