00001 #ifndef XML_PARSER_CLASS 00002 #define XML_PARSER_CLASS 00003 00004 /*****************************************************************************\ 00005 * * 00006 * Name : xml_parser * 00007 * Author : Chris Koeritz * 00008 * * 00009 ******************************************************************************* 00010 * Copyright (c) 2007-$now By Author. This program is free software; you can * 00011 * redistribute it and/or modify it under the terms of the GNU General Public * 00012 * License as published by the Free Software Foundation; either version 2 of * 00013 * the License or (at your option) any later version. This is online at: * 00014 * http://www.fsf.org/copyleft/gpl.html * 00015 * Please send any updates to: fred@gruntose.com * 00016 \*****************************************************************************/ 00017 00018 #include "textual_dll.h" 00019 00020 #include <basis/object_base.h> 00021 00022 // forward. 00023 class istring; 00024 class string_table; 00025 00027 00028 // hmmm, could this be the first class ever named this? perhaps it should be 00029 // in a textual namespace. -->after current sprint. 00030 00031 class TEXTUAL_CLASS_STYLE xml_parser 00032 { 00033 public: 00034 xml_parser(const istring &to_parse); 00035 virtual ~xml_parser(); 00036 00037 IMPLEMENT_CLASS_NAME("xml_parser"); 00038 00040 enum outcomes { 00041 OKAY = common::OKAY 00042 //uhhh... 00043 }; 00044 00045 static const char *outcome_name(const outcome &to_name); 00047 00048 void reset(const istring &to_parse); 00050 00051 outcome parse(); 00053 00056 virtual outcome header_callback(istring &header_name, 00057 string_table &attributes); 00059 00064 virtual outcome tag_open_callback(istring &tag_name, 00065 string_table &attributes); 00067 00068 virtual outcome tag_close_callback(istring &tag_name); 00070 00071 virtual outcome content_callback(istring &content); 00073 00074 private: 00075 istring *_xml_stream; // the stringful of xml information. 00076 00077 }; 00078 00079 #endif 00080
1.5.1