/src/wrappers/xml/library/xml2_doc.e

http://github.com/tybor/Liberty · Specman e · 51 lines · 40 code · 10 blank · 1 comment · 2 complexity · d07ddd6a13b43f6c95d7c57748c7a9dd MD5 · raw file

  1. note
  2. description: "."
  3. copyright: "[
  4. Copyright (C) 2008-2017: Paolo Redaelli
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public License
  7. as published by the Free Software Foundation; either version 2.1 of
  8. the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful, but
  10. WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. 02110-1301 USA
  17. ]"
  18. class XML2_DOC
  19. -- Minimal wrapper of xmlDoc type from libxml2.
  20. inherit
  21. C_STRUCT redefine free end
  22. EIFFEL_OWNED redefine free end
  23. insert
  24. LIBXML2_EXTERNALS
  25. SHARED_XML2_NODE_CACHE
  26. create {ANY} from_external_pointer
  27. feature {ANY}
  28. root: XML2_NODE
  29. do
  30. Result:=cache.wrapper(xml_doc_get_root_element(handle))
  31. end
  32. feature {} -- Implementation
  33. free (p: POINTER)
  34. do
  35. xml_free (p)
  36. end
  37. struct_size: INTEGER
  38. external "C use <libxml/tree.h>"
  39. alias "size_of (xmlDoc)"
  40. end
  41. end -- class XML2_DOC