Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

HTMLStream.hpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           HTMLStream.hpp  -  description
00003                              -------------------
00004     begin                : Fri Apr 11 2003
00005     copyright            : (C) 2003 by Tim Hawes
00006     email                : thawes@althusius.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef HTMLSTREAM_HPP
00019 #define HTMLSTREAM_HPP
00020 
00021 #include <SAXParser.hpp>
00022 
00023 #include <stack>
00024 #include <fstream>
00025 #include <iostream>
00026 #include <stdexcept>
00027 
00028 class HTMLStream : public SAXParser
00029   {
00030     private:
00039       std::string osstr;
00040 
00044       std::stack<std::string> r_name;
00045       std::stack<std::string> r_content;
00046 
00051       Attributes_t env;
00052 
00053     public:
00054       HTMLStream();
00055       ~HTMLStream();
00056 
00057       void sendHeader(std::string mime = "text/html");
00058       void characters
00059         (
00060           const std::string& name,
00061           const std::string& chars
00062         );
00063       void startElement
00064         (
00065           const std::string& name,
00066           Attributes_t& attr,
00067           bool standalone = false
00068         );
00069       void endElement(const std::string& name,
00070                       bool standalone = false);
00071 
00072       void processingInstruction
00073         (
00074           std::string& name,
00075           Attributes_t& attr
00076         );
00077 
00082       std::string handleVars(std::string& var);
00083 
00092       void setVars(Attributes_t& vars);
00093       void setVars(std::string& var, std::string& val);
00094       void setVars(char * ch, std::string& val);
00095 
00102       virtual void handleSegment(std::string& name, std::string& segment);
00103   };
00104 
00105 #endif // HTMLSTREAM_HPP

Generated on Mon Jul 21 20:05:31 2003 for HTMLTemplate by doxygen1.2.18