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.

xmlgeneric.h 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. Header for our common utilities for XML-based formats.
  3. Copyright (C) 2004, 2005, 2006, 2007 Robert Lipe, robertlipe@usa.net
  4. This program 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 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
  15. */
  16. typedef enum {
  17. cb_start = 1,
  18. cb_cdata,
  19. cb_end,
  20. } xg_cb_type;
  21. class QXmlStreamAttributes;
  22. typedef void (xg_callback)(xg_string, const QXmlStreamAttributes*);
  23. typedef struct xg_tag_mapping {
  24. xg_callback* tag_cb;
  25. xg_cb_type cb_type;
  26. const char* tag_name;
  27. } xg_tag_mapping;
  28. extern const char* xhtml_entities;
  29. void xml_ignore_tags(const char** taglist);
  30. void xml_init(const QString& fname, xg_tag_mapping* tbl,const char* encoding);
  31. void xml_init_offset(const char* fname, xg_tag_mapping* tbl,
  32. const char* encoding, gbsize_t offset);
  33. void xml_read(void);
  34. void xml_readstring(const char* str);
  35. void xml_readprefixstring(const char* str);
  36. void xml_readunicode(const QString& str);
  37. void xml_deinit(void);