tedi2html.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Header file of tedi2html
  3. * Copyright (C) <2022> <alkeon> [alkeon@autistici.org]
  4. * Texdi is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * Texdi is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with tedi2html. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef __TEDI2HTML__
  18. #define __TEDI2HTML__
  19. #include <iostream>
  20. #include <string>
  21. #include "../tedi2lang/tedi2lang.h"
  22. using namespace std;
  23. class tedi2html: public tedi2lang{
  24. public:
  25. tedi2html(tags_definition td);
  26. tedi2html();
  27. string convert(string text, string header, string footer);
  28. string convert_line_heading(string& line, size_t hash_position);
  29. string convert_line_list_start(string& line);
  30. void convert_line_list_item(string& line, size_t li);
  31. string convert_line_list_end(string& line);
  32. void convert_line_block(string& line);
  33. string convert_line_table(string& line, size_t first_pipe);
  34. string convert_line_ending(string& line);
  35. string convert_line_control_tags(string& line);
  36. tags_definition default_tags_value();
  37. string close_paragraph(bool& is_paragraph);
  38. private:
  39. const string _start_paragraph_tag;
  40. bool _is_paragraph;
  41. };
  42. #endif