Main Page   Class Hierarchy   Compound List   File List   Compound Members  

C_XmlParser.hpp

00001 /*
00002  *  This program is free software; you can redistribute it and/or modify
00003  *  it under the terms of the GNU General Public License as published by
00004  *  the Free Software Foundation; either version 2 of the License, or
00005  *  (at your option) any later version.
00006  *
00007  *  This program is distributed in the hope that it will be useful,
00008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  *  GNU General Public License for more details.
00011  *
00012  *  You should have received a copy of the GNU General Public License
00013  *  along with this program; if not, write to the Free Software
00014  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00015  *
00016  * (c)Copyright 2006 Hewlett-Packard Development Company, LP.
00017  *
00018  */
00019 
00020 #ifndef _C_XML_PARSER_H_
00021 #define _C_XML_PARSER_H_
00022 
00023 #include "C_XmlData.hpp"
00024 
00025 #include "string_t.hpp"
00026 #include "vector_t.hpp"
00027 #include <cstdio>
00028 
00029 class C_XmlParser {
00030 
00031 public:
00032    C_XmlParser();
00033   ~C_XmlParser();
00034 
00035   // lexical related actions
00036   int   lex_string_value_update (char) ;
00037   void  lex_string_value_reset () ;
00038   char *get_lex_string_value () ;
00039 
00040   void  lex_integer_update (char*) ;
00041   int   get_lex_integer ();
00042 
00043   // syntaxic related actions
00044   void  new_xml_data        (char *P_name) ;
00045   void  new_xml_field       (char *P_name) ;
00046   void  add_xml_field       (char *P_value) ;
00047   void  save_xml_data       () ;
00048   void  retrieve_xml_data   () ;
00049   void  add_sub_xml_data    () ;
00050   bool  check_xml_data_name (char *P_name, int P_line) ;
00051 
00052   C_XmlData * parse (int P_nb, string_t *P_fileName, int *P_error);
00053 
00054   string_t&   get_current_file_name() ;
00055   FILE*       next_file () ;
00056 
00057 private:
00058   // lexical information related data
00059   char*  m_lex_string_value ;
00060   int    m_lex_string_index ;
00061   int    m_lex_max_string_size ;
00062 
00063   int    m_lex_integer ;
00064 
00065   // syntaxic/action related data
00066   C_XmlData                                 *m_pCurrentXmlData, *m_pXmldata  ;
00067   vector_t<C_XmlData*>                       m_vector ; 
00068   vector_t<C_XmlData*>::reverse_iterator     m_vector_rit ;
00069   C_XmlData::C_XmlField                     *m_pXmlfield ;  
00070 
00071 
00072   // related file information
00073   string_t *m_file_name_table ;
00074   int    m_current_file    ;
00075   int    m_nb_file         ;
00076 
00077   void init () ;
00078 
00079 
00080 } ;
00081 
00082 #endif //  _C_XML_PARSER_H

Generated on Wed Mar 7 14:44:59 2007 for Seagull by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002