GnuCash
2.6.99
|
api for GnuCash version 2 XML-based file format More...
Go to the source code of this file.
Data Structures | |
struct | load_counter |
struct | sixtp_gdv2 |
struct | GncXmlDataType_t |
struct | gnc_template_xaction_data |
struct | conv_type |
Macros | |
#define | GNC_FILE_BACKEND "gnc:file:2" |
#define | GNC_FILE_BACKEND_VERS 2 |
Typedefs | |
typedef struct sixtp_gdv2 | sixtp_gdv2 |
typedef void(* | countCallbackFn )(sixtp_gdv2 *gd, const char *type) |
Functions | |
void | run_callback (sixtp_gdv2 *data, const char *type) |
gboolean | qof_session_load_from_xml_file_v2 (FileBackend *, QofBook *, QofBookFileType) |
gboolean | gnc_book_write_to_xml_filehandle_v2 (QofBook *book, FILE *fh) |
gboolean | gnc_book_write_to_xml_file_v2 (QofBook *book, const char *filename, gboolean compress) |
gboolean | gnc_book_write_accounts_to_xml_filehandle_v2 (QofBackend *be, QofBook *book, FILE *fh) |
gboolean | gnc_book_write_accounts_to_xml_file_v2 (QofBackend *be, QofBook *book, const char *filename) |
QofBookFileType | gnc_is_xml_data_file_v2 (const gchar *name, gboolean *with_encoding) |
gboolean | gnc_xml2_write_namespace_decl (FILE *out, const char *name_space) |
gint | gnc_xml2_find_ambiguous (const gchar *filename, GList *encodings, GHashTable **unique, GHashTable **ambiguous, GList **impossible) |
gboolean | gnc_xml2_parse_with_subst (FileBackend *fbe, QofBook *book, GHashTable *subst) |
api for GnuCash version 2 XML-based file format
Definition in file io-gncxml-v2.h.
#define GNC_FILE_BACKEND "gnc:file:2" |
Struct used to pass in a new data type for XML storage. This contains the set of callbacks to read and write XML for new data objects.. New types should register an instance of this object with the engine.
The create_parser() method will create a new sixtp parser for this data type.
The add_item() method takes a local state and a new object of this type and the method implementation should do whatever is necessary to cleanup the object and (maybe) add it into the book stored in the local-state.
The get_count() method returns the number of items of this type.
The write() method writes out all the objects of this particular type in the book and stores the XML in the FILE.
The scrub() method will take a completed, parsed QofBook* and post process the data, allowing you to 'scrub' the data.
The ns() method will output XML namespace information for the selected plug-in object.
Definition at line 99 of file io-gncxml-v2.h.
gboolean gnc_book_write_accounts_to_xml_filehandle_v2 | ( | QofBackend * | be, |
QofBook * | book, | ||
FILE * | fh | ||
) |
write just the commodities and accounts to a file
Definition at line 1369 of file io-gncxml-v2.c.
QofBookFileType gnc_is_xml_data_file_v2 | ( | const gchar * | name, |
gboolean * | with_encoding | ||
) |
The is_gncxml_file() routine checks to see if the first few chars of the file look like gnc-xml data.
Definition at line 1712 of file io-gncxml-v2.c.
gint gnc_xml2_find_ambiguous | ( | const gchar * | filename, |
GList * | encodings, | ||
GHashTable ** | unique, | ||
GHashTable ** | ambiguous, | ||
GList ** | impossible | ||
) |
Read a file as plain byte stream to find words that are not completely ASCII. On error, unique, ambiguous and impossible will be filled up to that point, -1 will be returned.
filename | Name of the file to read. |
encodings | List of encodings to check words for, each begin one a GQuark in a pointer. |
unique | Location used for a hash table for unique solutions, if not NULL. The byte sequence is the key, successful_conversion the value. |
ambiguous | Location used for a hash table for ambiguous byte sequences, if not NULL. The byte sequences is the key, a list of successful_conversions the value. |
impossible | Location used for a list for undecodable byte sequences, if not NULL. |
Definition at line 1829 of file io-gncxml-v2.c.
gboolean gnc_xml2_parse_with_subst | ( | FileBackend * | fbe, |
QofBook * | book, | ||
GHashTable * | subst | ||
) |
Parse a file in push mode, but replace byte sequences in the file given a hash table of substitutions
subst | hash table with keys and values of type gchar* |
Definition at line 2171 of file io-gncxml-v2.c.
gboolean gnc_xml2_write_namespace_decl | ( | FILE * | out, |
const char * | name_space | ||
) |
Write a name-space declaration for the provided namespace data type within the GNC XML namespace at http://www.gnucash.org/XML.
Definition at line 1278 of file io-gncxml-v2.c.
gboolean qof_session_load_from_xml_file_v2 | ( | FileBackend * | , |
QofBook * | , | ||
QofBookFileType | |||
) |
read in an account group from a file
Definition at line 865 of file io-gncxml-v2.c.
void run_callback | ( | sixtp_gdv2 * | data, |
const char * | type | ||
) |
Call after loading each record
Definition at line 109 of file io-gncxml-v2.c.