00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "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 result_ << "</li>" << endl;
00054 }
00055
00056 void
00057 marohtml::begin_controls(int num_controls)
00058 {
00059 result_ << "<li>MarControls = " << num_controls << endl;
00060 result_ << "<ul>" << endl;
00061 }
00062
00063 void
00064 marohtml::begin_control(std::string type, std::string name, std::string value, bool has_state)
00065 {
00066 if (value=="")
00067 result_ << "<li>" << type << "/" << name << " = " << "MARSYAS_EMPTYSTRING" << "</li>" << endl;
00068 else
00069 result_ << "<li>" << type << "/" << name << " = " << value << "</li>" << endl;
00070 }
00071 void
00072 marohtml::begin_control_links_in(int num_links)
00073 {
00074 result_ << "<li>LinksTo = " << num_links << endl;
00075 result_ << "<ul>";
00076 }
00077 void
00078 marohtml::put_control_link_in(std::string abspath, std::string type, std::string name)
00079 {
00080 result_ << "<li>" << abspath << "//" << type << "/" << name << "</li>" << endl;
00081 }
00082
00083 void
00084 marohtml::end_control_links_in(int num_links)
00085 {
00086 result_ << "</ul></li>" << endl;
00087 }
00088
00089 void
00090 marohtml::begin_control_links_out(int num_links)
00091 {
00092 result_ << "<li>LinksFrom = " << num_links << endl;
00093 result_ << "<ul>";
00094 }
00095 void
00096 marohtml::put_control_link_out(std::string abspath, std::string type, std::string name)
00097 {
00098 result_ << "<li>" << abspath << "//" << type << "/" << name << "</li>" << endl;
00099 }
00100 void
00101 marohtml::end_control_links_out(int num_links)
00102 {
00103 result_ << "</ul></li>" << endl;
00104 }
00105
00106 void
00107 marohtml::end_control(std::string type, std::string name, std::string value, bool has_state)
00108 {
00109 }
00110 void
00111 marohtml::end_controls(int num_links)
00112 {
00113 result_ << "</ul>" << endl;
00114 result_ << "</li>" << endl;
00115 }
00116
00117 void
00118 marohtml::begin_children(int num_children)
00119 {
00120 result_ << "<li>Components = " << num_children << endl;
00121 result_ << "<ul>" << endl;
00122 }
00123
00124 void
00125 marohtml::end_children(int num_children)
00126 {
00127 result_ << "</ul>" << endl;
00128 result_ << "</li>" << endl;
00129 }
00130
00131 std::string
00132 marohtml::str()
00133 {
00134 return "<html><head></head><body>" + result_.str() + "</body></html>";
00135 }