The xml tool project provides developers functions that uses the libxml2 library.
It provides an easy way to input and output configurations from/to xml files and handlers to deal with small or big xml databases.

Main Page | File List | File Members

xmltool.h File Reference

the xmltools core main header. More...

Go to the source code of this file.

Enumerations

enum  returns {
  N_MAP_UNEXIST = -4, PARENT_UNEXIST = -3, CHILD_UNEXIST = -2, INCORRECT_INPUT = -1,
  NO_ERROR = 0, CHILD_EXISTS = 1, PARENT_EXISTS = 2, FILE_UNEXIST = 3,
  NODE_SAME_CONTENT = 4
}

Functions

void Xmltool_Perror (char *message)
void Xmltool_SetError (int source)
void Xmltool_GetError (int *destination)
int Xmltool_WriteToXml (char *filename, char *parent_name, char *node_name, char *node_info)
char * Xmltool_ReadFromXml (char *filename, char *parent_name, char *child_name)
int Xmltool_EditToXml (char *filename, char *parent_name, char *node_name, char *node_info)
int Xmltool_RemoveFromXml (char *filename, char *parent_name, char *child_name)
int Xmltool_GetXmlDesc (char *filename)
int Xmltool_MAddXml (char *filename)
node_map * Xmltool_MReadXml (char *filename, char *parent_node, char *node_name, char *content)
void Xmltool_Clean ()


Detailed Description

the xmltools core main header.

This file contains the main functions used for xml handling.


Enumeration Type Documentation

enum returns
 

Sets the error types returned by the functions


Function Documentation

void Xmltool_Clean  ) 
 

clean up Xmltools. Call this before the program closes, at least.

int Xmltool_EditToXml char *  filename,
char *  parent_name,
char *  node_name,
char *  node_info
 

Modify a single value of a node

Parameters:
filename  the xml file
parent_name  parent node of the node
node_name  node to edit
node_info  New data to add to the node

void Xmltool_GetError int *  destination  ) 
 

FIXME

Parameters:
destination  FIXME

int Xmltool_GetXmlDesc char *  filename  ) 
 

This function actually checks and parse the DtD of an xml file.

Parameters:
filename  file to read from

int Xmltool_MAddXml char *  filename  ) 
 

This function is to dump the data loaded, with Nmap_Add, in the xml file.

Parameters:
filename  file to write to

struct node_map* Xmltool_MReadXml char *  filename,
char *  parent_node,
char *  node_name,
char *  content
 

Reads a file that has a repetitive number of parent nodes (as set in the DtD).

Parameters:
filename  the xml file.
parent_node  parent node of the node.
node_name  node that has a unique data(compared to the other nodes)
content  content that the child must have to be recognised

void Xmltool_Perror char *  message  ) 
 

prints the error description. This functions has to be used to be given a short description of an eventual error.

Parameters:
message  this is for the user to add extra informations (like the function name it was called from).

char* Xmltool_ReadFromXml char *  filename,
char *  parent_name,
char *  child_name
 

Read a single value of a node

Parameters:
filename  the xml file
parent_name  parent node of the node
child_name  node to read

int Xmltool_RemoveFromXml char *  filename,
char *  parent_name,
char *  child_name
 

Delete a single node

Parameters:
filename  the xml file
parent_name  parent node of the node
child_name  the node to delete

void Xmltool_SetError int  source  ) 
 

Internal, do not use. The name is self explanatory anyway.

Parameters:
source  the error number

int Xmltool_WriteToXml char *  filename,
char *  parent_name,
char *  node_name,
char *  node_info
 

Write a single value to a node

Parameters:
filename  xml file
parent_name  parent node of the node
node_name  node to add
node_info  data to add to the node


Generated on Sun Dec 26 16:25:54 2004 for XmlTools by  doxygen 1.3.9.1
SourceForge.net Logo