parser.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include <string>
  2. #include <vector>
  3. using namespace std;
  4. class parser{
  5. bool _channel;
  6. bool _item;
  7. bool _content;
  8. int _channel_tags;
  9. int _item_tags;
  10. string _channel_title;
  11. string _channel_link;
  12. string _item_title;
  13. string _item_link;
  14. string _item_description;
  15. vector<string> _links;
  16. vector<string> _titles;
  17. vector<string> _descriptions;
  18. public:
  19. parser(): _channel(false), _item(false), _content(false), _channel_tags(0), _item_tags(0){}
  20. void rss(string line);
  21. void rss_link(string& line);
  22. void rss_description(string& line);
  23. void rss_start_item(string& line);
  24. void rss_end_description(string& line);
  25. void rss_end_item(string& line);
  26. void detect_rss_standard(const string& rss_text);
  27. void atom(string line);
  28. void title(string& line);
  29. int next_tag(const string& line);
  30. int next_tag_atom(const string& line);
  31. void atom_link(string& line);
  32. void atom_description(string& line);
  33. void atom_start_item(string& line);
  34. void atom_end_description(string& line);
  35. void atom_end_item(string& line);
  36. void get_news();
  37. void download_news(const string& xml);
  38. void delete_tags(string& line);
  39. void clean_string(string& line);
  40. void escape_character_sql(string& line);
  41. string decode_html_chars(string line);
  42. };