cleanup, start adding support for lots

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6883 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 2002-05-21 05:22:55 +00:00
parent 3504798dec
commit 8179770a6d
4 changed files with 26 additions and 19 deletions

View File

@ -18,6 +18,7 @@ libgncmod_backend_file_la_SOURCES = \
gnc-book-xml-v2.c \
gnc-commodity-xml-v2.c \
gnc-freqspec-xml-v2.c \
gnc-lot-xml-v2.c \
gnc-pricedb-xml-v2.c \
gnc-schedxaction-xml-v2.c \
gnc-transaction-xml-v2.c \

View File

@ -2,6 +2,7 @@
* gnc-account-xml-v2.c -- account xml i/o implementation *
* *
* Copyright (C) 2001 James LewisMoss <dres@debian.org> *
* Copyright (C) 2002 Linas Vepstas <linas@linas.org> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
@ -70,6 +71,8 @@ const gchar *account_version_string = "2.0.0";
xmlNodePtr
gnc_account_dom_tree_create(Account *act)
{
const char *str;
kvp_frame *kf;
xmlNodePtr ret;
ret = xmlNewNode(NULL, gnc_account_string);
@ -90,24 +93,22 @@ gnc_account_dom_tree_create(Account *act)
xmlAddChild(ret, int_to_dom_tree(act_commodity_scu_string,
xaccAccountGetCommoditySCU(act)));
if(xaccAccountGetCode(act) &&
strlen(xaccAccountGetCode(act)) > 0)
str = xaccAccountGetCode(act);
if (str && strlen(str) > 0)
{
xmlAddChild(ret, text_to_dom_tree(act_code_string,
xaccAccountGetCode(act)));
xmlAddChild(ret, text_to_dom_tree(act_code_string, str));
}
if(xaccAccountGetDescription(act) &&
strlen(xaccAccountGetDescription(act)) > 0)
str = xaccAccountGetDescription(act);
if (str && strlen(str) > 0)
{
xmlAddChild(ret, text_to_dom_tree(act_description_string,
xaccAccountGetDescription(act)));
xmlAddChild(ret, text_to_dom_tree(act_description_string, str));
}
if(xaccAccountGetSlots(act))
kf = xaccAccountGetSlots(act);
if(kf)
{
xmlNodePtr kvpnode = kvp_frame_to_dom_tree(act_slots_string,
xaccAccountGetSlots(act));
xmlNodePtr kvpnode = kvp_frame_to_dom_tree(act_slots_string, kf);
if(kvpnode)
{
xmlAddChild(ret, kvpnode);

View File

@ -45,11 +45,11 @@ sixtp* gnc_book_slots_sixtp_parser_create(void);
xmlNodePtr gnc_commodity_dom_tree_create(const gnc_commodity *com);
sixtp* gnc_commodity_sixtp_parser_create(void);
xmlNodePtr gnc_transaction_dom_tree_create(Transaction *txn);
sixtp* gnc_transaction_sixtp_parser_create(void);
xmlNodePtr gnc_freqSpec_dom_tree_create( FreqSpec *fs );
sixtp* gnc_freqSpec_sixtp_parser_create(void);
xmlNodePtr split_to_dom_tree(const gchar *tag, Split *spl);
Split* dom_tree_to_split(xmlNodePtr node, GNCBook *book);
xmlNodePtr gnc_lot_dom_tree_create(GNCLot *);
sixtp* gnc_lot_sixtp_parser_create(void);
xmlNodePtr gnc_pricedb_dom_tree_create(GNCPriceDB *db);
sixtp* gnc_pricedb_sixtp_parser_create(void);
@ -57,8 +57,11 @@ sixtp* gnc_pricedb_sixtp_parser_create(void);
xmlNodePtr gnc_schedXaction_dom_tree_create( SchedXaction *sx );
sixtp* gnc_schedXaction_sixtp_parser_create(void);
xmlNodePtr gnc_freqSpec_dom_tree_create( FreqSpec *fs );
sixtp* gnc_freqSpec_sixtp_parser_create(void);
xmlNodePtr split_to_dom_tree(const gchar *tag, Split *spl);
Split* dom_tree_to_split(xmlNodePtr node, GNCBook *book);
xmlNodePtr gnc_transaction_dom_tree_create(Transaction *txn);
sixtp* gnc_transaction_sixtp_parser_create(void);
sixtp* gnc_template_transaction_sixtp_parser_create(void);

View File

@ -1,6 +1,6 @@
/********************************************************************
* sixtp-dom-parsers.h *
* Copyright 2001 Gnumatic, Inc. *
* Copyright (c) 2001 Gnumatic, Inc. *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
@ -68,8 +68,10 @@ kvp_value* dom_tree_to_frame_kvp_value(xmlNodePtr node);
gboolean dom_tree_to_integer(xmlNodePtr node, gint64 *daint);
/* higher level structures */
Account* dom_tree_to_account(xmlNodePtr node, GNCBook *book);
GNCBook* dom_tree_to_book(xmlNodePtr node, GNCBook *book);
GNCBook* dom_tree_to_book (xmlNodePtr node, GNCBook *book);
GNCLot* dom_tree_to_lot (xmlNodePtr node, GNCBook *book);
Transaction* dom_tree_to_transaction(xmlNodePtr node, GNCBook *book);
struct dom_tree_handler