示例#1
0
void frmReport::XmlAddSectionTableFromListView(const int section, ctlListView *list)
{
	// Get the column headers
	int cols = list->GetColumnCount();

	wxString data;
	wxListItem itm;

	// Build the columns
	for (int x = 0; x < cols; x++)
	{
		itm.SetMask(wxLIST_MASK_TEXT);
		list->GetColumn(x, itm);
		wxString label = itm.GetText();
		data += wxT("        <column id=\"c");
		data += NumToStr((long)(x + 1));
		data += wxT("\" number=\"");
		data += NumToStr((long)(x + 1));
		data += wxT("\" name=\"");
		data += HtmlEntities(label);
		data += wxT("\" />\n");
	}
	sectionTableHeader[section - 1] = data;

	// Build the rows
	int rows = list->GetItemCount();

	for (int y = 0; y < rows; y++)
	{
		data = wxT("        <row id=\"r");
		data += NumToStr((long)(y + 1));
		data += wxT("\" number=\"");
		data += NumToStr((long)(y + 1));
		data += wxT("\"");

		for (int x = 0; x < cols; x++)
		{
			data += wxT(" c");
			data += NumToStr((long)(x + 1));
			data += wxT("=\"");
			data += HtmlEntities(list->GetText(y, x));
			data += wxT("\"");
		}
		data += wxT(" />\n");
		sectionTableRows[section - 1] += data;
	}
}
示例#2
0
void frmReport::XmlSetSectionSql(int section, const wxString &sql)
{
	sectionSql[section - 1] = HtmlEntities(sql);

	if (!sectionSql[section - 1].IsEmpty())
		chkSql->Enable();
	else
		chkSql->Disable();
}
示例#3
0
int frmReport::XmlCreateSection(const wxString &name)
{
	int ind = sectionName.Add(HtmlEntities(name));
	sectionData.Add(wxT(""));
	sectionTableHeader.Add(wxT(""));
	sectionTableRows.Add(wxT(""));
	sectionTableInfo.Add(wxT(""));
	sectionSql.Add(wxT(""));
	return ind + 1;
}
void HtmlPullParser_UnitTests() {
    Test00("<p a1='>' foo=bar />", HtmlToken::EmptyElementTag);
    Test00("<p a1 ='>'     foo=\"bar\"/>", HtmlToken::EmptyElementTag);
    Test00("<p a1=  '>' foo=bar>", HtmlToken::StartTag);
    Test00("</><!-- < skip > --><p a1=\">\" foo=bar>", HtmlToken::StartTag);
    Test00("<P A1='>' FOO=bar />", HtmlToken::EmptyElementTag);
    HtmlEntities();
    Test01();
    Test02();
    Test03();
}
示例#5
0
	void CompoundWriter::prepareClassSubtitle(const Section& section)
	{
		subtitle = "<tr><td class=\"doxnone\"></td><td class=\"doxnone\">";

		if (not section.caption.empty())
		{
			HtmlEntities(sectionName, section.caption);
			subtitle << "<h3 class=\"doxygen_section\">" << sectionName << " <code class=\"doxygen_visibility\">" << visibility << "</code></h3>\n";
		}
		else
		{
			sectionName.clear();
			subtitle << "<h3 class=\"doxygen_section\">" << visibility << " <code class=\"doxygen_visibility\">" << visibility << "</code></h3>\n";
		}
		subtitle << "</td></tr>\n";
	}
示例#6
0
void frmReport::XmlSetSectionTableHeader(const int section, int columns, const wxChar *name, ...)
{
	va_list ap;
	const wxChar *p = name;
	wxString data;

	va_start(ap, name);

	for (int x = 0; x < columns; x++)
	{
		data += wxT("        <column id=\"c");
		data += NumToStr((long)(x + 1));
		data += wxT("\" number=\"");
		data += NumToStr((long)(x + 1));
		data += wxT("\" name=\"");
		data += HtmlEntities(p);
		data += wxT("\"/>\n");
		p = va_arg(ap, wxChar *);
	}

	va_end(ap);

	sectionTableHeader[section - 1] = data;
}
示例#7
0
文件: gui.cpp 项目: ekumlin/Cubyx-IRC
void cWindowOutputCtrl::AppendFormattedText(const wxString &Str, int style, ChannelWindowColor color) {
    Freeze();
    wxString& String = wxString(Str);
    HtmlEntities(String);
    bool Underline = false;
    bool Bold = false;
    int BgColor = (int)COLOR_WHITE;
    int Color = (int)color;

    wxString& ps = wxString("");
    for (unsigned int i = 0; i < String.Len(); i++) {
        wxString& s = String.Mid(i,1);
        if (!s.Cmp(wxString::Format("%c",2))) {
            if (Bold) {
                Bold = false;
            } else {
                Bold = true;
            }
        } else if (!s.Cmp(wxString::Format("%c",3))) {
            wxString& Mid11 = String.Mid(i+1,1);
            wxString& Mid12 = String.Mid(i+1,2);
            wxString& Mid21 = String.Mid(i+2,1);
            wxString& Mid22 = String.Mid(i+2,2);
            wxString& Mid31 = String.Mid(i+3,1);
            wxString& Mid32 = String.Mid(i+3,2);
            wxString& Mid41 = String.Mid(i+4,1);
            wxString& Mid42 = String.Mid(i+4,2);
            if (Mid12.IsNumber() && atoi(Mid12) > 0 && atoi(Mid12) <= 15) {
                Color = atoi(Mid12);
                i += 2;
                if (Mid31 == ",") {
                    if (Mid42.IsNumber() && atoi(Mid42) > 0 && atoi(Mid42) <= 15) {
                        BgColor = atoi(Mid42);
                        i += 3;
                    } else if (Mid41.IsNumber() && (!Mid41.Cmp("0") || (atoi(Mid41) > 0 && atoi(Mid41) <= 9))) {
                        BgColor = atoi(Mid41);
                        i += 2;
                    }
                }
            } else if (Mid11.IsNumber() && (!Mid11.Cmp("0") || (atoi(Mid11) > 0 && atoi(Mid11) <= 9))) {
                Color = atoi(Mid11);
                i += 1;
                if (Mid21 == ",") {
                    if (Mid32.IsNumber() && atoi(Mid32) > 0 && atoi(Mid32) <= 15) {
                        BgColor = atoi(Mid32);
                        i += 3;
                    } else if (Mid31.IsNumber() && (!Mid31.Cmp("0") || (atoi(Mid31) > 0 && atoi(Mid31) <= 9))) {
                        BgColor = atoi(Mid31);
                        i += 2;
                    }
                }
            } else {
                Color = (int)color;
                BgColor = (int)COLOR_WHITE;
            }
            ps.Append(wxString::Format("</font><font color='#%s' bgcolor='#%s'>",GetWxColorStringFromInt(GetIntColorFromEnum(Color)).c_str(),GetWxColorStringFromInt(GetIntColorFromEnum(BgColor)).c_str()));
        } else if (!s.Cmp(wxString::Format("%c",15))) {
            Underline = false;
            Bold = false;
            int StyleToApply = style;
            if (StyleToApply >= STYLE_UNDERLINE) {
                StyleToApply -= STYLE_UNDERLINE;
                Underline = true;
            }
            if (StyleToApply >= STYLE_BOLD) {
                StyleToApply -= STYLE_BOLD;
                Bold = true;
            }
            Color = (int)color;
        } else if (!s.Cmp(wxString::Format("%c",31))) {
            if (Underline) {
                Underline = false;
            } else {
                Underline = true;
            }
        } else {
            if (Bold) {
                s.Prepend("<b>");
                s.Append("</b>");
            }
            if (Underline) {
                s.Prepend("<u>");
                s.Append("</u>");
            }
            ps.Append(s);
        }
    }
    AppendToPage(wxString::Format("<br /><font color='#%s' bgcolor='#%s'>%s</font>",GetWxColorStringFromInt(GetIntColorFromEnum((int)color)).c_str(),GetWxColorStringFromInt(GetIntColorFromEnum((int)COLOR_WHITE)).c_str(),ps.c_str()));
    Scroll(-1,INT_MAX);
    Thaw();
}
示例#8
0
void frmReport::XmlAddSectionValue(const int section, const wxString &name, const wxString &value)
{
	sectionData[section - 1] += wxT("    <") + HtmlEntities(name) + wxT(">") + HtmlEntities(value) + wxT("</") + HtmlEntities(name) + wxT(">\n");
}
示例#9
0
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// START XML FUNCTIONS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void frmReport::XmlAddHeaderValue(const wxString &name, const wxString &value)
{
	header += wxT("    <") + HtmlEntities(name) + wxT(">") + HtmlEntities(value) + wxT("</") + HtmlEntities(name) + wxT(">\n");
}
示例#10
0
wxString frmReport::GetDefaultXsl(const wxString &css)
{
	wxString data;

	data = wxT("<?xml version=\"1.0\"?>\n")
	       wxT("<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n")
	       wxT("<xsl:output method=\"xml\" doctype-system=\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" doctype-public=\"-//W3C//DTD XHTML 1.0 Transitional//EN\" indent=\"yes\" encoding=\"utf-8\" />\n")
	       wxT("<xsl:template match=\"/report\">\n")
	       wxT("\n")
	       wxT("<html>\n")
	       wxT("  <head>\n")
	       wxT("    <xsl:if test=\"header/title != ''\">\n")
	       wxT("      <title><xsl:value-of select=\"header/title\" /></title>\n")
	       wxT("    </xsl:if>\n")
	       wxT("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
	data += css;
	data += wxT("  </head>\n")
	        wxT("\n")
	        wxT("  <body>\n")
	        wxT("    <div id=\"ReportHeader\">\n")
	        wxT("\n")
	        wxT("    <xsl:if test=\"header/title != ''\">\n")
	        wxT("      <h1><xsl:value-of select=\"header/title\" /></h1>\n")
	        wxT("    </xsl:if>\n")
	        wxT("\n")
	        wxT("    <xsl:if test=\"header/generated != ''\">\n")
	        wxT("      <b>");
	data +=   _("Generated");
	data += wxT(": </b><xsl:value-of select=\"header/generated\" /><br />\n")
	        wxT("    </xsl:if>\n")
	        wxT("\n")
	        wxT("    <xsl:if test=\"header/server != ''\">\n")
	        wxT("      <b>");
	data +=   _("Server");
	data += wxT(": </b><xsl:value-of select=\"header/server\" /><br />\n")
	        wxT("    </xsl:if>\n")
	        wxT("\n")
	        wxT("    <xsl:if test=\"header/database != ''\">\n")
	        wxT("      <b>");
	data +=   _("Database");
	data += wxT(": </b><xsl:value-of select=\"header/database\" /><br />\n")
	        wxT("    </xsl:if>\n")
	        wxT("\n")
	        wxT("    <xsl:if test=\"header/catalog != ''\">\n")
	        wxT("      <b>");
	data +=   _("Catalog");
	data += wxT(": </b><xsl:value-of select=\"header/catalog\" /><br />\n")
	        wxT("    </xsl:if>\n")
	        wxT("\n")
	        wxT("    <xsl:if test=\"header/schema != ''\">\n")
	        wxT("      <b>");
	data +=   _("Schema");
	data += wxT(": </b><xsl:value-of select=\"header/schema\" /><br />\n")
	        wxT("    </xsl:if>\n")
	        wxT("\n")
	        wxT("    <xsl:if test=\"header/table != ''\">\n")
	        wxT("      <b>");
	data +=   _("Table");
	data += wxT(": </b><xsl:value-of select=\"header/table\" /><br />\n")
	        wxT("    </xsl:if>\n")
	        wxT("\n")
	        wxT("    <xsl:if test=\"header/job != ''\">\n")
	        wxT("      <b>");
	data +=   _("Job");
	data += wxT(": </b><xsl:value-of select=\"header/job\" /><br />\n")
	        wxT("    </xsl:if>\n")
	        wxT("\n")
	        wxT("    </div>\n")
	        wxT("\n")
	        wxT("    <xsl:if test=\"header/notes != ''\">\n")
	        wxT("      <div id=\"ReportNotes\">\n")
	        wxT("      <b>");
	data +=   _("Notes");
	data += wxT(": </b><br /><br />\n")
	        wxT("      <xsl:call-template name=\"substitute\">\n")
	        wxT("         <xsl:with-param name=\"string\" select=\"header/notes\" />\n")
	        wxT("      </xsl:call-template>\n")
	        wxT("      </div>\n")
	        wxT("    </xsl:if>\n")
	        wxT("\n")
	        wxT("    <div id=\"ReportDetails\">\n")
	        wxT("      <xsl:apply-templates select=\"section\" >\n")
	        wxT("        <xsl:sort select=\"@number\" data-type=\"number\" order=\"ascending\" />\n")
	        wxT("      </xsl:apply-templates>\n")
	        wxT("    </div>\n")
	        wxT("\n")
	        wxT("    <div id=\"ReportFooter\">\n");
	data +=   _("Report generated by");
	data += wxT(" <a href=\"");
	data += HtmlEntities(appearanceFactory->GetWebsiteUrl());
	data += wxT("\">");
	data += HtmlEntities(appearanceFactory->GetLongAppName());
	data += wxT("</a>\n")
	        wxT("    </div>\n")
	        wxT("\n")
	        wxT("    <br />\n")
	        wxT("  </body>\n")
	        wxT("</html>\n")
	        wxT("\n")
	        wxT("</xsl:template>\n")
	        wxT("\n")
	        wxT("<xsl:template match=\"section\">\n")
	        wxT("  <xsl:if test=\"../section[@id = current()/@id]/@name != ''\">\n")
	        wxT("    <h2><xsl:value-of select=\"../section[@id = current()/@id]/@name\" /></h2>\n")
	        wxT("  </xsl:if>\n")
	        wxT("\n")
	        wxT("  <xsl:if test=\"count(../section[@id = current()/@id]/table/columns/column) > 0\">\n")
	        wxT("    <div style=\"overflow:auto;\">\n")
	        wxT("      <table>\n")
	        wxT("        <tr>\n")
	        wxT("          <xsl:apply-templates select=\"../section[@id = current()/@id]/table/columns/column\">\n")
	        wxT("            <xsl:sort select=\"@number\" data-type=\"number\" order=\"ascending\" />\n")
	        wxT("            <xsl:with-param name=\"count\" select=\"count(../section[@id = current()/@id]/table/columns/column)\" />\n")
	        wxT("          </xsl:apply-templates>\n")
	        wxT("        </tr>\n")
	        wxT("        <xsl:apply-templates select=\"../section[@id = current()/@id]/table/rows/*\" mode=\"rows\">\n")
	        wxT("          <xsl:sort select=\"@number\" data-type=\"number\" order=\"ascending\" />\n")
	        wxT("          <xsl:with-param name=\"column-meta\" select=\"../section[@id = current()/@id]/table/columns/column\" />\n")
	        wxT("        </xsl:apply-templates>\n")
	        wxT("      </table>\n")
	        wxT("    </div>\n")
	        wxT("    <br />\n")
	        wxT("    <xsl:if test=\"../section[@id = current()/@id]/table/info != ''\">\n")
	        wxT("      <p class=\"ReportTableInfo\"><xsl:value-of select=\"../section[@id = current()/@id]/table/info\" /></p>\n")
	        wxT("    </xsl:if>\n")
	        wxT("  </xsl:if>\n")
	        wxT("\n")
	        wxT("  <xsl:if test=\"../section[@id = current()/@id]/sql != ''\">\n")
	        wxT("    <pre class=\"ReportSQL\">\n")
	        wxT("      <xsl:call-template name=\"substitute\">\n")
	        wxT("         <xsl:with-param name=\"string\" select=\"../section[@id = current()/@id]/sql\" />\n")
	        wxT("      </xsl:call-template>\n")
	        wxT("    </pre>\n")
	        wxT("  </xsl:if>\n")
	        wxT("</xsl:template>\n")
	        wxT("\n")
	        wxT("<xsl:template match=\"column\">\n")
	        wxT("  <xsl:param name=\"count\" />\n")
	        wxT("  <th class=\"ReportTableHeaderCell\">\n")
	        wxT("  <xsl:attribute name=\"width\"><xsl:value-of select=\"100 div $count\" />%</xsl:attribute>\n")
	        wxT("    <xsl:call-template name=\"substitute\">\n")
	        wxT("       <xsl:with-param name=\"string\" select=\"@name\" />\n")
	        wxT("    </xsl:call-template>\n")
	        wxT("  </th>\n")
	        wxT("</xsl:template>\n")
	        wxT("\n")
	        wxT("<xsl:template match=\"*\" mode=\"rows\">\n")
	        wxT("  <xsl:param name=\"column-meta\" />\n")
	        wxT("  <tr>\n")
	        wxT("  <xsl:choose>\n")
	        wxT("  <xsl:when test=\"position() mod 2 != 1\">\n")
	        wxT("    <xsl:attribute name=\"class\">ReportDetailsOddDataRow</xsl:attribute>\n")
	        wxT("  </xsl:when>\n")
	        wxT("  <xsl:otherwise>\n")
	        wxT("    <xsl:attribute name=\"class\">ReportDetailsEvenDataRow</xsl:attribute>\n")
	        wxT("  </xsl:otherwise>\n")
	        wxT("  </xsl:choose>\n")
	        wxT("    <xsl:apply-templates select=\"$column-meta\" mode=\"cells\">\n")
	        wxT("      <xsl:with-param name=\"row\" select=\".\" />\n")
	        wxT("    </xsl:apply-templates>\n")
	        wxT("  </tr>\n")
	        wxT("</xsl:template>\n")
	        wxT("\n")
	        wxT("<xsl:template match=\"*\" mode=\"cells\">\n")
	        wxT("  <xsl:param name=\"row\" />\n")
	        wxT("    <td class=\"ReportTableValueCell\">\n")
	        wxT("    <xsl:choose>\n")
	        wxT("      <xsl:when test=\"$row/@*[name() = current()/@id]|$row/*[name() = current()/@id] != ''\">\n")
	        wxT("        <xsl:call-template name=\"substitute\">\n")
	        wxT("          <xsl:with-param name=\"string\" select=\"$row/@*[name() = current()/@id]|$row/*[name() = current()/@id]\" />\n")
	        wxT("        </xsl:call-template>\n")
	        wxT("      </xsl:when>\n")
	        wxT("      <xsl:otherwise>\n")
	        wxT("        <xsl:text> </xsl:text>\n")
	        wxT("      </xsl:otherwise>\n")
	        wxT("    </xsl:choose>\n")
	        wxT("  </td>\n")
	        wxT("</xsl:template>\n")
	        wxT("\n")
	        wxT("<xsl:template name=\"substitute\">\n")
	        wxT("   <xsl:param name=\"string\" />\n")
	        wxT("   <xsl:param name=\"from\" select=\"'&#xA;'\" />\n")
	        wxT("   <xsl:param name=\"to\">\n")
	        wxT("      <br />\n")
	        wxT("   </xsl:param>\n")
	        wxT("   <xsl:choose>\n")
	        wxT("      <xsl:when test=\"contains($string, $from)\">\n")
	        wxT("         <xsl:value-of select=\"substring-before($string, $from)\" />\n")
	        wxT("         <xsl:copy-of select=\"$to\" />\n")
	        wxT("         <xsl:call-template name=\"substitute\">\n")
	        wxT("            <xsl:with-param name=\"string\" select=\"substring-after($string, $from)\" />\n")
	        wxT("            <xsl:with-param name=\"from\" select=\"$from\" />\n")
	        wxT("            <xsl:with-param name=\"to\" select=\"$to\" />\n")
	        wxT("         </xsl:call-template>\n")
	        wxT("      </xsl:when>\n")
	        wxT("      <xsl:otherwise>\n")
	        wxT("         <xsl:value-of select=\"$string\" />\n")
	        wxT("      </xsl:otherwise>\n")
	        wxT("   </xsl:choose>\n")
	        wxT("</xsl:template>\n")
	        wxT("\n")
	        wxT("</xsl:stylesheet>\n");

	return data;
}
示例#11
0
void frmHint::SetHint(const wxString &info)
{
	currentHint = hintnos.Item(0);

	bool canSuppress = false;
	if (hintnos.GetCount() == 1)
	{
		if (hintArray[currentHint].flags & HINT_CANSUPPRESS)
			canSuppress = true;
		SetTitle(_("Guru Hint") + wxString(wxT(" - ")) + wxGetTranslation(hintArray[currentHint].hintCaption));

		wxString page = GetPage(hintArray[currentHint].hintPage);
		page.Replace(wxT("<INFO>"), HtmlEntities(info));

		htmlHint->SetPage(page);
	}
	else
	{
		SetTitle(_("Guru Hints"));

		wxString header = GetPage(wxT("multiple"));
		wxString pages;

		if (header.IsEmpty())
		{
			header =
			    wxT("<html><head>\n")
			    wxT("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">\n")
			    wxT("<link rel=\"STYLESHEET\" type=\"text/css\" href=\"../pgadmin3.css\">\n")
			    wxT("<title>Guru Hints</title></head>\n")
			    wxT("<body><p>\n");
		}
		else
		{
			int o = header.Find(wxT("</body>"));
			if (o > 0)
				header = header.Left(o) + wxT("<p>");
		}

		size_t i;
		for (i = 0 ; i < hintnos.GetCount() ; i++)
		{
			int hintno = hintnos.Item(i);
			if (hintArray[hintno].flags & HINT_CANSUPPRESS)
				canSuppress = true;
			wxString page = GetPage(hintArray[hintno].hintPage);
			int a = page.Find(wxT("<body>"));
			int o = page.Find(wxT("</body>"));
			if (a < 0)
				a = 0;
			if (o < 0)
				o = wxString::npos;


			int ha = page.Find(wxT("<H3>"));
			int ho = page.Find(wxT("</H3>"));
			if (ha < 0)
				ha = page.Find(wxT("<h3>"));
			if (ho < 0)
				ho = page.Find(wxT("</h3>"));

			if (ha > a && ho > ha)
			{
				wxString hintTitle = page.Mid(ha + 4, ho - ha - 4);

				pages  += page.Mid(a, ha - a)
				          + wxT("<H3><A Name=\"") + hintArray[hintno].hintPage + wxT("\">")
				          + hintTitle + wxT("</A>")
				          + page.Mid(ho, o - ho);
				header += wxString(wxT("<A HREF=\"#")) + hintArray[hintno].hintPage + wxT("\">")
				          + hintTitle + wxT("</A><BR>");
			}
			else
				pages += page.Mid(a, o - a);
		}

		pages.Replace(wxT("<INFO>"), info);
		pages.Replace(wxT("<INFO/>"), info);

		htmlHint->SetPage(header + wxT("</p>") + pages + wxT("</body></html>\n"));
	}

	chkSuppress->SetValue(false);
	chkSuppress->Enable(!force && canSuppress);

	if (force || !(hintArray[currentHint].flags & HINT_CANABORT))
		btnCancel->Disable();
	if (!(hintArray[currentHint].flags & HINT_CANFIX))
		btnFix->Hide();

	if (!(hintArray[currentHint].flags & HINT_CANFIX))
		btnFix->Hide();
	else if (hintArray[currentHint].fixText)
		btnFix->SetLabel(wxGetTranslation(hintArray[currentHint].fixText));

	if (hintArray[currentHint].flags & HINT_YESNO)
		btnOK->Hide();
	else
	{
		btnYes->Hide();
		btnNo->Hide();
	}
};
示例#12
0
	void CompoundWriter::appendClassFunction(const Member& member, bool isPublic)
	{
		Clob& outIx = outC[isPublic][kdFunction];
		if (outIx.empty())
			outIx << "<table class=\"nostyle\">";
		outIx << "<tr><td class=\"doxygen_index\"><code>";
		if (member.isStatic)
			outIx << "<span class=\"keyword\">static</span> ";
		outIx << type << ' ';
		outIx << "</code></td><td class=\"doxygen_index_def\"><code>";

		if (!member.templates.empty())
		{
			out << "<div class=\"doxygen_tmpllist\">";
			out << "<span class=\"keyword\">template</span>&lt;";
			for (uint p = 0; p != member.templates.size(); ++p)
			{
				if (p)
					out << ", ";
				const Parameter::Ptr& paramstr = member.templates[p];
				const Parameter& param = *paramstr;
				HtmlEntities(paramType, param.type);
				HtmlEntities(paramName, param.name);
				ArrangeTypename(paramType);
				out << paramType << ' ' << paramName;
			}
			out << "&gt;</div>\n";
		}

		if (name.first() == '~')
		{
			String t = name;
			t.replace("~", "<b> ~ </b>");
			out << " <span class=\"method\"><a name=\"" << member.htmlID << "\" href=\"#\">" << umlSymbol << ' ' << t << "</a></span>";
			outIx << " <span class=\"method\"><a href=\"#" << member.htmlID << "\">" << t << "</a></span>";
		}
		else
		{
			out << " <span class=\"method\"><a name=\"" << member.htmlID << "\" href=\"#\">" << umlSymbol << ' ' << name << "</a></span>";
			outIx << " <span class=\"method\"><a href=\"#" << member.htmlID << "\">" << name << "</a></span>";
		}

		out << ": ";

		if (member.isStatic)
			out   << "<span class=\"keyword\">static</span> ";

		out   << type << " (";
		outIx << '(';

		for (uint p = 0; p != member.parameters.size(); ++p)
		{
			if (p)
			{
				out << ", ";
				outIx << ", ";
			}
			const Parameter::Ptr& paramstr = member.parameters[p];
			const Parameter& param = *paramstr;
			HtmlEntities(paramType, param.type);
			HtmlEntities(paramName, param.name);
			ArrangeTypename(paramType);
			out << paramType << ' ' << paramName;
			outIx << paramType << ' ' << paramName;
		}

		out << ')';
		outIx << ')';

		if (member.isConst)
		{
			out  << " <span class=\"keyword\">const</span>";
			outIx << " <span class=\"keyword\">const</span>";
		}
		out << ";\n";
		outIx << "</code></td></tr>\n";
	}
示例#13
0
	void CompoundWriter::appendClassSection(const Section& section, bool isAbstract)
	{
		umlSymbol = '+';
		visibility.clear();
		bool isPublic = true;

		if (section.kind.startsWith("public-"))
			visibility = "Public";
		else if (section.kind.startsWith("protected-"))
		{
			// Protected and private data should not be displayed when the class is not inherited
			if (!isAbstract)
				return;
			visibility = "Protected";
			umlSymbol = '#';
			isPublic = false;
		}
		else if (section.kind.startsWith("private-"))
		{
			// Skipping all private members
			return;
			//visibility = "Private";
			//umlSymbol = '-';
		}
		else
			visibility = "Public";

		// class subtitle
		prepareClassSubtitle(section);

		bool subtitleAlreadyWritten = false;
		bool firstIndexMember = true;
		uint memcount = (uint) section.members.size();
		for (uint j = 0; j != memcount; ++j)
		{
			const Member::Ptr& memberptr = section.members[j];
			const Member& member = *memberptr;
			if (member.name == "YUNI_STATIC_ASSERT")
				continue;
			if (member.kind == kdFriend)
				continue;

			if (!subtitleAlreadyWritten)
			{
				out << subtitle;
				subtitleAlreadyWritten = true;
			}

			if (firstIndexMember && (member.kind == kdFunction || member.kind == kdTypedef))
			{
				firstIndexMember = false;
				Clob& outIx = outC[isPublic][member.kind];
				if (outIx.empty())
				{
					outIx<< "<table class=\"nostyle\">";
					outIx << "<tr><td></td><td><h4>";
				}
				else
					outIx << "<tr><td></td><td><br /><h4>";
				outIx << sectionName << "</h4></td></tr>\n";
			}

			out << "<tr>";

			id.clear() << member.name << '_' << (++GenerationNumericID) << DateTime::Now();
			id.replace('-', '_'); // prevent against int overflow
			toggle.clear() << "toggleVisibility('" << id << "')";

			HtmlEntities(name, member.name);
			HtmlEntities(type, member.type);
			ArrangeTypename(type);

			switch (member.kind)
			{
				case kdFunction: out << "<td class=\"doxygen_fun\">";break;
				case kdTypedef:  out << "<td class=\"doxygen_typedef\">";break;
				case kdVariable: out << "<td class=\"doxygen_var\">";break;
				case kdEnum:     out << "<td class=\"doxygen_enum\">";break;
				default: out << "<td>";break;
			}
			out << "</td><td class=\"doxnone\"><div class=\"doxygen_brief\">";

			if (not member.brief.empty())
				out << "<b>" << member.brief << "</b><div class=\"doxygen_name_spacer\"></div>\n";
			out << "<code>";

			switch (member.kind)
			{
				case kdFunction:
					appendClassFunction(member, isPublic);
					break;
				case kdTypedef:
					appendClassTypedef(member, isPublic);
					break;
				case kdVariable:
					appendClassVariable();
					break;
				default:
					out << "<i>(unmanaged tag: " << (uint) member.kind << ")</i>";
					break;
			}

			out << "</code>\n";

			out << "</div></td>";

			out << "</tr>";
			out << "<tr><td class=\"doxnone doxreturn\"></td><td class=\"doxnone\">\n";
			out << "<div class=\"doxygen_name_spacer\"></div>\n<div class=\"doxygen_desc\">";

			if (not member.detailedDescription.empty())
				out << member.detailedDescription;

			out << "\n</div>\n";
			out << "</td>";
			out << "</tr>\n";

		} // each member
	}