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.

60 lines
1.9 KiB

11 years ago
  1. #ifndef DATAFILE_READ_WRITE_H_
  2. #define DATAFILE_READ_WRITE_H_
  3. /*
  4. * This program source code file is part of KiCad, a free EDA CAD application.
  5. *
  6. * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #include <pcb_calculator_datafile_lexer.h>
  22. class PCB_CALCULATOR_DATAFILE_PARSER;
  23. /**
  24. * PCB_CALCULATOR_DATAFILE
  25. * handles data to calculate regulators parameters
  26. */
  27. class PCB_CALCULATOR_DATAFILE
  28. {
  29. public:
  30. PCB_CALCULATOR_DATAFILE( REGULATOR_LIST * aList );
  31. int WriteHeader( OUTPUTFORMATTER* aFormatter ) const ;
  32. void Format( OUTPUTFORMATTER* aFormatter, int aNestLevel ) const ;
  33. void Parse( PCB_CALCULATOR_DATAFILE_PARSER* aParser );
  34. private:
  35. friend class PCB_CALCULATOR_DATAFILE_PARSER;
  36. protected:
  37. REGULATOR_LIST* m_list;
  38. };
  39. /**
  40. * Parser for PCB_CALCULATOR_DATAFILE.
  41. */
  42. class PCB_CALCULATOR_DATAFILE_PARSER : public PCB_CALCULATOR_DATAFILE_LEXER
  43. {
  44. public:
  45. PCB_CALCULATOR_DATAFILE_PARSER( LINE_READER* aReader );
  46. PCB_CALCULATOR_DATAFILE_PARSER( char* aLine, const wxString& aSource );
  47. LINE_READER* GetReader() { return reader; };
  48. void Parse( PCB_CALCULATOR_DATAFILE* aDataList );
  49. void ParseRegulatorDescr( PCB_CALCULATOR_DATAFILE* aDataList );
  50. };
  51. #endif // PDATAFILE_READ_WRITE_H_