Data Structures | |
struct | cr_XmlFile |
Defines | |
#define | cr_xmlfile_open_primary(FILENAME, COMTYPE, ERR) cr_xmlfile_open(FILENAME, CR_XMLFILE_PRIMARY, COMTYPE, ERR) |
#define | cr_xmlfile_sopen_primary(FILENAME, COMTYPE, STAT, ERR) cr_xmlfile_sopen(FILENAME, CR_XMLFILE_PRIMARY, COMTYPE, STAT, ERR) |
#define | cr_xmlfile_open_filelists(FILENAME, COMTYPE, ERR) cr_xmlfile_open(FILENAME, CR_XMLFILE_FILELISTS, COMTYPE, ERR) |
#define | cr_xmlfile_sopen_filelists(FILENAME, COMTYPE, STAT, ERR) cr_xmlfile_sopen(FILENAME, CR_XMLFILE_FILELISTS, COMTYPE, STAT, ERR) |
#define | cr_xmlfile_open_other(FILENAME, COMTYPE, ERR) cr_xmlfile_open(FILENAME, CR_XMLFILE_OTHER, COMTYPE, ERR) |
#define | cr_xmlfile_sopen_other(FILENAME, COMTYPE, STAT, ERR) cr_xmlfile_sopen(FILENAME, CR_XMLFILE_OTHER, COMTYPE, STAT, ERR) |
#define | cr_xmlfile_open(FILENAME, TYPE, COMTYPE, ERR) cr_xmlfile_sopen(FILENAME, TYPE, COMTYPE, NULL, ERR) |
Enumerations | |
enum | cr_XmlFileType { CR_XMLFILE_PRIMARY, CR_XMLFILE_FILELISTS, CR_XMLFILE_OTHER, CR_XMLFILE_SENTINEL } |
Functions | |
cr_XmlFile * | cr_xmlfile_sopen (const char *filename, cr_XmlFileType type, cr_CompressionType comtype, cr_ContentStat *stat, GError **err) |
int | cr_xmlfile_set_num_of_pkgs (cr_XmlFile *f, long num, GError **err) |
int | cr_xmlfile_add_pkg (cr_XmlFile *f, cr_Package *pkg, GError **err) |
int | cr_xmlfile_add_chunk (cr_XmlFile *f, const char *chunk, GError **err) |
int | cr_xmlfile_close (cr_XmlFile *f, GError **err) |
#define cr_xmlfile_open | ( | FILENAME, | |||
TYPE, | |||||
COMTYPE, | |||||
ERR | ) | cr_xmlfile_sopen(FILENAME, TYPE, COMTYPE, NULL, ERR) |
Open a new XML file with stats. Note: Opened file must not exists! This function cannot open existing file!.
FILENAME | Filename. | |
TYPE | Type of XML file. | |
COMTYPE | Type of used compression. | |
ERR | **GError |
Definition at line 126 of file xml_file.h.
#define cr_xmlfile_open_filelists | ( | FILENAME, | |||
COMTYPE, | |||||
ERR | ) | cr_xmlfile_open(FILENAME, CR_XMLFILE_FILELISTS, COMTYPE, ERR) |
Open a new filelists XML file.
FILENAME | Filename. | |
COMTYPE | Type of used compression. | |
ERR | GError ** |
Definition at line 85 of file xml_file.h.
#define cr_xmlfile_open_other | ( | FILENAME, | |||
COMTYPE, | |||||
ERR | ) | cr_xmlfile_open(FILENAME, CR_XMLFILE_OTHER, COMTYPE, ERR) |
Open a new other XML file.
FILENAME | Filename. | |
COMTYPE | Type of used compression. | |
ERR | GError ** |
Definition at line 104 of file xml_file.h.
#define cr_xmlfile_open_primary | ( | FILENAME, | |||
COMTYPE, | |||||
ERR | ) | cr_xmlfile_open(FILENAME, CR_XMLFILE_PRIMARY, COMTYPE, ERR) |
Open a new primary XML file.
FILENAME | Filename. | |
COMTYPE | Type of compression. | |
ERR | GError ** |
Definition at line 66 of file xml_file.h.
#define cr_xmlfile_sopen_filelists | ( | FILENAME, | |||
COMTYPE, | |||||
STAT, | |||||
ERR | ) | cr_xmlfile_sopen(FILENAME, CR_XMLFILE_FILELISTS, COMTYPE, STAT, ERR) |
Open a new filelists XML file.
FILENAME | Filename. | |
COMTYPE | Type of compression. | |
STAT | cr_ContentStat object or NULL. | |
ERR | GError ** |
Definition at line 95 of file xml_file.h.
#define cr_xmlfile_sopen_other | ( | FILENAME, | |||
COMTYPE, | |||||
STAT, | |||||
ERR | ) | cr_xmlfile_sopen(FILENAME, CR_XMLFILE_OTHER, COMTYPE, STAT, ERR) |
Open a new other XML file.
FILENAME | Filename. | |
COMTYPE | Type of compression. | |
STAT | cr_ContentStat object or NULL. | |
ERR | GError ** |
Definition at line 114 of file xml_file.h.
#define cr_xmlfile_sopen_primary | ( | FILENAME, | |||
COMTYPE, | |||||
STAT, | |||||
ERR | ) | cr_xmlfile_sopen(FILENAME, CR_XMLFILE_PRIMARY, COMTYPE, STAT, ERR) |
Open a new primary XML file.
FILENAME | Filename. | |
COMTYPE | Type of compression. | |
STAT | cr_ContentStat object or NULL. | |
ERR | GError ** |
Definition at line 76 of file xml_file.h.
enum cr_XmlFileType |
Supported types of xml files
CR_XMLFILE_PRIMARY |
primary.xml |
CR_XMLFILE_FILELISTS |
filelists.xml |
CR_XMLFILE_OTHER |
other.xml |
CR_XMLFILE_SENTINEL |
sentinel of the list |
Definition at line 38 of file xml_file.h.
int cr_xmlfile_add_chunk | ( | cr_XmlFile * | f, | |
const char * | chunk, | |||
GError ** | err | |||
) |
Add (write) string with XML chunk into the file. Note: Because of writing, in case of multithreaded program, shoud be guarded by locks, this function could be much more effective than cr_xml_file_add_pkg(). In case of _add_pkg() function, creating of string with xml chunk is done in a critical section. In _add_chunk() function, you could just dump XML whenever you want and in the critical section do only writting.
f | An opened cr_XmlFile | |
chunk | String with XML chunk. | |
err | **GError |
int cr_xmlfile_add_pkg | ( | cr_XmlFile * | f, | |
cr_Package * | pkg, | |||
GError ** | err | |||
) |
Add package to the xml file.
f | An opened cr_XmlFile | |
pkg | Package object. | |
err | **GError |
int cr_xmlfile_close | ( | cr_XmlFile * | f, | |
GError ** | err | |||
) |
int cr_xmlfile_set_num_of_pkgs | ( | cr_XmlFile * | f, | |
long | num, | |||
GError ** | err | |||
) |
Set total number of packages that will be in the file. This number must be set before any write operation (cr_xml_add_pkg, cr_xml_file_add_chunk, ..).
f | An opened cr_XmlFile | |
num | Total number of packages in the file. | |
err | **GError |
cr_XmlFile* cr_xmlfile_sopen | ( | const char * | filename, | |
cr_XmlFileType | type, | |||
cr_CompressionType | comtype, | |||
cr_ContentStat * | stat, | |||
GError ** | err | |||
) |
Open a new XML file. Note: Opened file must not exists! This function cannot open existing file!.
filename | Filename. | |
type | Type of XML file. | |
comtype | Type of used compression. | |
stat | pointer to cr_ContentStat or NULL | |
err | **GError |