Marsyas  0.6.0-alpha
/usr/src/RPM/BUILD/marsyas-0.6.0/src/marsyas/marohtml.cpp
Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 1998-2005 George Tzanetakis <gtzan@cs.uvic.ca>
00003 **
00004 ** This program is free software; you can redistribute it and/or modify
00005 ** it under the terms of the GNU General Public License as published by
00006 ** the Free Software Foundation; either version 2 of the License, or
00007 ** (at your option) any later version.
00008 **
00009 ** This program is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 ** GNU General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU General Public License
00015 ** along with this program; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 */
00018 
00019 
00020 #include <marsyas/marohtml.h>
00021 #include <sstream>
00022 #include <iostream>
00023 
00024 using namespace std;
00025 using namespace Marsyas;
00026 
00027 marohtml::marohtml() : marostring()
00028 {
00029 }
00030 
00031 marohtml::~marohtml()
00032 {
00033   clear();
00034 }
00035 
00036 void
00037 marohtml::begin_marsystem(bool isComposite, std::string type, std::string name)
00038 {
00039   if(isComposite)
00040     result_ << "<li>MarSystemComposite" << endl;
00041   else
00042     result_ << "<li>MarSystem" << endl;
00043 
00044   result_ << "Type = " << type << endl;
00045   result_ << "Name = " << name << endl;
00046 
00047   result_ << endl;
00048 }
00049 
00050 void
00051 marohtml::end_marsystem(bool isComposite, std::string type, std::string name)
00052 {
00053   (void) isComposite;
00054   (void) type;
00055   (void) name;
00056   result_ << "</li>" << endl;
00057 }
00058 
00059 void
00060 marohtml::begin_controls(int num_controls)
00061 {
00062   result_ << "<li>MarControls = " << num_controls << endl;
00063   result_ << "<ul>" << endl;
00064 }
00065 
00066 void
00067 marohtml::begin_control(std::string type, std::string name, std::string value, bool has_state)
00068 {
00069   (void) has_state;
00070   if (value=="")
00071     result_ << "<li>" << type << "/" << name << " = " << "MARSYAS_EMPTYSTRING" << "</li>" << endl;
00072   else
00073     result_ << "<li>" << type << "/" << name << " = " << value << "</li>" << endl;
00074 }
00075 void
00076 marohtml::begin_control_links_in(int num_links)
00077 {
00078   result_ << "<li>LinksTo = " << num_links << endl;
00079   result_ << "<ul>";
00080 }
00081 void
00082 marohtml::put_control_link_in(std::string abspath, std::string type, std::string name)
00083 {
00084   result_ << "<li>" << abspath << "//" << type << "/" << name << "</li>" << endl;
00085 }
00086 
00087 void
00088 marohtml::end_control_links_in(int num_links)
00089 {
00090   (void) num_links;
00091   result_ << "</ul></li>" << endl;
00092 }
00093 
00094 void
00095 marohtml::begin_control_links_out(int num_links)
00096 {
00097   result_ << "<li>LinksFrom = " << num_links << endl;
00098   result_ << "<ul>";
00099 }
00100 void
00101 marohtml::put_control_link_out(std::string abspath, std::string type, std::string name)
00102 {
00103   result_ << "<li>" << abspath << "//" << type << "/" << name << "</li>" << endl;
00104 }
00105 void
00106 marohtml::end_control_links_out(int num_links)
00107 {
00108   (void) num_links;
00109   result_ << "</ul></li>" << endl;
00110 }
00111 
00112 void
00113 marohtml::end_control(std::string type, std::string name, std::string value, bool has_state)
00114 {
00115   (void) type;
00116   (void) name;
00117   (void) value;
00118   (void) has_state;
00119 }
00120 void
00121 marohtml::end_controls(int num_links)
00122 {
00123   (void) num_links;
00124   result_ << "</ul>" << endl;
00125   result_ << "</li>" << endl;
00126 }
00127 
00128 void
00129 marohtml::begin_children(int num_children)
00130 {
00131   result_ << "<li>Components = " << num_children << endl;
00132   result_ << "<ul>" << endl;
00133 }
00134 
00135 void
00136 marohtml::end_children(int num_children)
00137 {
00138   (void) num_children;
00139   result_ << "</ul>" << endl;
00140   result_ << "</li>" << endl;
00141 }
00142 
00143 std::string
00144 marohtml::str()
00145 {
00146   return "<html><head></head><body>" + result_.str() + "</body></html>";
00147 }