}
}
+
+ public void start_element_func (MarkupParseContext context,
+ string element_name,
+ string[] attribute_names,
+ string[] attribute_values) throws MarkupError
+ {
+ debug ("Start: %s", element_name);
+ }
+
+ public void end_element_func (MarkupParseContext context,
+ string element_name) throws MarkupError
+ {
+ debug ("End: %s", element_name);
+ }
+
+ public void text_element_func (MarkupParseContext context,
+ string text,
+ size_t text_len) throws MarkupError
+ {
+ debug ("Text element: %s", text);
+/* for (string i in context.get_element_stack ())
+ {
+ stdout.printf("%s\n", i);
+ }*/
+ }
+
+ public void parser_error (MarkupParseContext context,
+ Error error)
+ {
+ debug ("error");
+ }
public static int main (string[] args)
{
- int64 size;
+ string text = "";
if (args.length < 2)
{
error ("Usage %s [-a] WEB_PROVISIONING_FILE", args[0]);
try
{
- var info = file.query_info ("standard::size", FileQueryInfoFlags.NONE);
- size = info.get_size();
+ var dis = new DataInputStream (file.read ());
+ string line;
+ while ((line = dis.read_line (null)) != null)
+ text += line;
}
catch (Error e)
{
error ("Could not retreive file size");
}
+ MarkupParser parser = {start_element_func, end_element_func, text_element_func, null, parser_error};
+
+
return 0;
}
}