From 04dc598a1fb195065403055fbb95589dd3511daa Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 21 Dec 2009 12:59:17 -0500 Subject: [PATCH] add obt_parse_save_file() method to the obt parse library --- obt/parse.c | 7 +++++++ obt/parse.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/obt/parse.c b/obt/parse.c index b7c34ab1..b44e968d 100644 --- a/obt/parse.c +++ b/obt/parse.c @@ -277,6 +277,13 @@ gboolean obt_parse_load_mem(ObtParseInst *i, return r; } +gboolean obt_parse_save_file(ObtParseInst *inst, + const gchar *path, + gboolean pretty) +{ + return xmlSaveFormatFile(path, inst->doc, pretty) != -1; +} + void obt_parse_close(ObtParseInst *i) { if (i && i->doc) { diff --git a/obt/parse.h b/obt/parse.h index acc3f5c6..400acf94 100644 --- a/obt/parse.h +++ b/obt/parse.h @@ -51,6 +51,10 @@ gboolean obt_parse_load_theme_file(ObtParseInst *inst, gboolean obt_parse_load_mem(ObtParseInst *inst, gpointer data, guint len, const gchar *root_node); +gboolean obt_parse_save_file(ObtParseInst *inst, + const gchar *path, + gboolean pretty); + xmlDocPtr obt_parse_doc(ObtParseInst *inst); xmlNodePtr obt_parse_root(ObtParseInst *inst);