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.

65 lines
2.3 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-2011 KiCad Developers, see change_log.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
  19. * along with this program; if not, you may find one here:
  20. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  21. * or you may search the http://www.gnu.org website for the version 2 license,
  22. * or you may write to the Free Software Foundation, Inc.,
  23. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  24. */
  25. #include <wx/wx.h>
  26. #include <pcb_calculator_datafile_lexer.h>
  27. #include <base_struct.h>
  28. class PCB_CALCULATOR_DATAFILE_PARSER;
  29. /**
  30. * Class PCB_CALCULATOR_DATAFILE
  31. * handles data to calculate regulators parameters
  32. */
  33. class PCB_CALCULATOR_DATAFILE
  34. {
  35. friend class PCB_CALCULATOR_DATAFILE_PARSER;
  36. protected:
  37. REGULATOR_LIST * m_list;
  38. public:
  39. PCB_CALCULATOR_DATAFILE( REGULATOR_LIST * aList );
  40. int WriteHeader( OUTPUTFORMATTER* aFormatter ) const throw( IO_ERROR );
  41. void Format( OUTPUTFORMATTER* aFormatter, int aNestLevel ) const throw( IO_ERROR );
  42. void Parse( PCB_CALCULATOR_DATAFILE_PARSER* aParser ) throw( IO_ERROR, PARSE_ERROR );
  43. };
  44. /**
  45. * Class PCB_CALCULATOR_DATAFILE_PARSER
  46. * is the parser class for PCB_CALCULATOR_DATAFILE.
  47. */
  48. class PCB_CALCULATOR_DATAFILE_PARSER : public PCB_CALCULATOR_DATAFILE_LEXER
  49. {
  50. public:
  51. PCB_CALCULATOR_DATAFILE_PARSER( LINE_READER* aReader );
  52. PCB_CALCULATOR_DATAFILE_PARSER( char* aLine, wxString aSource );
  53. LINE_READER* GetReader() { return reader; };
  54. void Parse( PCB_CALCULATOR_DATAFILE* aDataList ) throw( IO_ERROR, PARSE_ERROR );
  55. void ParseRegulatorDescr( PCB_CALCULATOR_DATAFILE* aDataList ) throw( IO_ERROR, PARSE_ERROR );
  56. };
  57. #endif // PDATAFILE_READ_WRITE_H_