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.

67 lines
1.8 KiB

  1. #ifndef ITEM_XMLFUNC_INCLUDED
  2. #define ITEM_XMLFUNC_INCLUDED
  3. /* Copyright (C) 2000-2005 MySQL AB
  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; version 2 of the License.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
  14. /* This file defines all XML functions */
  15. #ifdef __GNUC__
  16. #pragma interface /* gcc class implementation */
  17. #endif
  18. class Item_xml_str_func: public Item_str_func
  19. {
  20. protected:
  21. String tmp_value, pxml;
  22. Item *nodeset_func;
  23. public:
  24. Item_xml_str_func(Item *a, Item *b):
  25. Item_str_func(a,b)
  26. {
  27. maybe_null= TRUE;
  28. }
  29. Item_xml_str_func(Item *a, Item *b, Item *c):
  30. Item_str_func(a,b,c)
  31. {
  32. maybe_null= TRUE;
  33. }
  34. void fix_length_and_dec();
  35. String *parse_xml(String *raw_xml, String *parsed_xml_buf);
  36. };
  37. class Item_func_xml_extractvalue: public Item_xml_str_func
  38. {
  39. public:
  40. Item_func_xml_extractvalue(Item *a,Item *b) :Item_xml_str_func(a,b) {}
  41. const char *func_name() const { return "extractvalue"; }
  42. String *val_str(String *);
  43. };
  44. class Item_func_xml_update: public Item_xml_str_func
  45. {
  46. String tmp_value2, tmp_value3;
  47. public:
  48. Item_func_xml_update(Item *a,Item *b,Item *c) :Item_xml_str_func(a,b,c) {}
  49. const char *func_name() const { return "updatexml"; }
  50. String *val_str(String *);
  51. };
  52. #endif /* ITEM_XMLFUNC_INCLUDED */