add basic libxml2 reader support
authorRaffaele Sandrini <rasa@gmx.ch>
Thu, 15 Jun 2006 07:57:35 +0000 (07:57 +0000)
committerRaffaele Sandrini <rasa@src.gnome.org>
Thu, 15 Jun 2006 07:57:35 +0000 (07:57 +0000)
2006-06-15  Raffaele Sandrini <rasa@gmx.ch>

        * vapi/libxml-2.0.vala: add basic libxml2 reader support

svn path=/trunk/; revision=45

vala/ChangeLog
vala/vapi/libxml-2.0.vala [new file with mode: 0644]

index 6572cc8..0a436c7 100644 (file)
@@ -1,3 +1,7 @@
+2006-06-15  Raffaele Sandrini <rasa@gmx.ch>
+
+       * vapi/libxml-2.0.vala: add basic libxml2 reader support
+
 2006-06-14  Jürg Billeter  <j@bitron.ch>
 
        * vala/parser.y: set is_lvalue_ref in property declarations
diff --git a/vala/vapi/libxml-2.0.vala b/vala/vapi/libxml-2.0.vala
new file mode 100644 (file)
index 0000000..a2b17bd
--- /dev/null
@@ -0,0 +1,104 @@
+/* libxml2.vala
+ *
+ * Copyright (C) 2006  Jürg Billeter, Raffaele Sandrini
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ *
+ * Author:
+ *     Jürg Billeter <j@bitron.ch>
+ *     Raffaele Sandrini <rasa@gmx.ch>
+ */
+
+namespace Xml {
+       [ReferenceType ()]
+       [CCode (cname = "xmlTextReader", cheader_filename = "libxml/xmlreader.h")]
+       public struct TextReader {
+               [CCode (cname = "xmlNewTextReaderFilename")]
+               public static ref TextReader new_with_filename (string uri);
+               
+               [CCode (cname = "xmlReaderForFile")]
+               public static ref TextReader new_from_file (string filename, string encoding, int options);
+               
+               [CCode (cname = "xmlTextReaderRead")]
+               public int read ();
+               
+               [CCode (cname = "xmlTextReaderReadString")]
+               public ref string read_string ();
+               
+               [CCode (cname = "xmlTextReaderClose")]
+               public int close ();
+               
+               [CCode (cname = "xmlTextReaderIsValid")]
+               public int is_valid ();
+               
+               [CCode (cname = "xmlFreeTextReader")]
+               public void free ();
+               
+               [CCode (cname = "xmlTextReaderReadState")]
+               public int read_state ();
+               
+               [CCode (cname = "xmlTextReaderNodeType")]
+               public int node_type ();
+               
+               [CCode (cname = "xmlTextReaderConstName")]
+               public string const_name ();
+               
+               [CCode (cname = "xmlTextReaderConstValue")]
+               public string const_value ();
+               
+               [CCode (cname = "xmlTextReaderDepth")]
+               public int depth ();
+               
+               [CCode (cname = "xmlTextReaderIsEmptyElement")]
+               public int is_empty_element ();
+               
+               [CCode (cname = "xmlTextReaderHasValue")]
+               public int has_value ();                
+       }
+
+/*     
+       [CCode (cname = "xmlTextReaderMode", cheader_filename = "liReaderTypesReaderTypesbxml/xmlreader.h")]
+       public enum ReaderMode {
+               INITIAL,
+               INTERACTIVE,
+               ERROR,
+               EOF,
+               CLOSED,
+               READING
+       }
+       
+       [CCode (cname = "xmlReaderTypes",  cheader_filename = "libxml/xmlreader.h")]
+       public enum ReaderTypes {
+               NONE,
+               ELEMENT,
+               ATTRIBUTE,
+               TEXT,
+               CDATA,
+               ENTITY_REFERENCE,
+               ENTITY,
+               PROCESSING_INSTRUCTION,
+               COMMENT,
+               DOCUMENT,
+               DOCUMENT_TYPE,
+               DOCUMENT_FRAGMENT,
+               NOTATION,
+               WHITESPACE,
+               SIGNIFICANT_WHITESPACE,
+               END_ELEMENT,
+               END_ENTITY,
+               XML_DECLARATION
+       }
+*/
+}