You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ovbt_sg_cpp_define_generator.cpp 526B

1234567891011121314151617181920212223242526
  1. #include "ovbt_sg_defines.h"
  2. #include <fstream>
  3. bool CCppDefineGenerator::openFile(const char* filename)
  4. {
  5. m_file.open(filename, std::ios::out | std::ios::trunc);
  6. if (!m_file.is_open()) { return false; }
  7. m_file << "#pragma once" << std::endl << std::endl;
  8. return true;
  9. }
  10. bool CCppDefineGenerator::appendStimulation(SStimulation& stim)
  11. {
  12. m_file << "#define " << stim.id << " " << stim.hexa << std::endl;
  13. return true;
  14. }
  15. bool CCppDefineGenerator::closeFile()
  16. {
  17. m_file << std::endl;
  18. m_file.close();
  19. return true;
  20. }