Documentation of the MLV-0.6.713 library

MLV_xml.h

00001 /*
00002  *   This file is part of the MLV Library.
00003  *
00004  *   Copyright (C) 2010,2011,2012 Adrien Boussicault, Marc Zipstein
00005  *
00006  *
00007  *    This Library is free software: you can redistribute it and/or modify
00008  *    it under the terms of the GNU General Public License as published by
00009  *    the Free Software Foundation, either version 3 of the License, or
00010  *    (at your option) any later version.
00011  *
00012  *    This Library is distributed in the hope that it will be useful,
00013  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *    GNU General Public License for more details.
00016  *
00017  *    You should have received a copy of the GNU General Public License
00018  *    along with this Library.  If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00039 #ifndef __MLV__MLV_XML_H__
00040 #define __MLV__MLV_XML_H__
00041 
00042 #include <stdarg.h>
00043 
00044 #ifdef __cplusplus
00045 extern "C" {
00046 #endif
00047 
00051 typedef struct _MLV_Xml MLV_Xml;
00052 
00062 MLV_Xml* MLV_load_xml( const char* xml_file_path );
00063 
00069 void MLV_free_xml( MLV_Xml* xml_data );
00070 
00075 typedef enum {
00076         MLV_XML_NONE, 
00077         MLV_XML_THE_FIELD_DOESNT_EXIST, 
00078         MLV_XML_THE_FIELD_IS_NOT_A_REAL, 
00079         MLV_XML_THE_FIELD_IS_NOT_AN_INTEGER, 
00080         MLV_XML_THE_FIELD_IS_TOO_BIG 
00081 } MLV_Xml_error;
00082 
00118 MLV_Xml_error MLV_get_string_value_from_xml(
00119         const MLV_Xml* xml_data, char** result , const char* xpath, ...
00120 );
00121 
00134 MLV_Xml_error MLV_get_string_value_from_xml_va(
00135         const MLV_Xml* xml_data, char** result, const char* xpath, va_list pile
00136 );
00137 
00138 
00152 MLV_Xml_error MLV_get_integer_value_from_xml(
00153         const MLV_Xml* xml_data, int* result, const char* xpath, ...
00154 );
00155 
00169 MLV_Xml_error MLV_get_double_value_from_xml(
00170         const MLV_Xml* xml_data, double* result, const char* xpath, ...
00171 );
00172 
00186 MLV_Xml_error MLV_get_float_value_from_xml(
00187         const MLV_Xml* xml_data, float* result, const char* xpath, ...
00188 );
00189 
00190 
00202 int MLV_get_number_of_objects_from_xml(
00203         const MLV_Xml* xml_data, const char* xpath, ...
00204 );
00205 
00218 MLV_Xml* MLV_get_xml_object_of( const MLV_Xml* xml_data, const char* xpath, ... );
00219 
00228 void MLV_print_xml( const MLV_Xml* xml_data );
00229 
00230 #ifdef __cplusplus
00231 }
00232 #endif
00233 
00234 #endif