tedi2tex.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * This file is the main code of Texdi
  3. * Copyright (C) <2021> <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 Texdi. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef __TEDI2TEX__
  18. #define __TEDI2TEX__
  19. #include <iostream>
  20. #include <string>
  21. #include "../tedi2lang/tedi2lang.h"
  22. using namespace std;
  23. class tedi2tex: public tedi2lang{
  24. public:
  25. tedi2tex(tags_definition td);
  26. tedi2tex();
  27. tags_definition default_tags_value();
  28. string convert_line(string& line);
  29. void convert_line_image(string& line);
  30. void convert_line_block(string& line);
  31. string convert_line_table_row(string& line);
  32. string convert_line_table(string& line, size_t first_pipe);
  33. string convert_line_control_tags(string& line);
  34. int get_table_columns(string line);
  35. string get_table_start_tag(string& line);
  36. void escape_underscores(string& line);
  37. bool found(size_t position){ return (position != string::npos); }
  38. private:
  39. const string _start_paragraph_tag;
  40. bool _is_paragraph;
  41. };
  42. #endif