<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[C++ Bibliothek, die Html Dateien generieren kann]]></title><description><![CDATA[<p>Hi!<br />
Ich habe die Nase voll von std::cout.setwXXX und was weiß ich noch! Ich brauche eine Bibliothek mit der Tabellen leicht zu erstellen sind. Eine html Ausgabe wäre ganz in Ordnung. Gibt es so was?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/214639/c-bibliothek-die-html-dateien-generieren-kann</link><generator>RSS for Node</generator><lastBuildDate>Sun, 11 Oct 2026 08:47:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/214639.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 01 Jun 2008 12:04:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to C++ Bibliothek, die Html Dateien generieren kann on Sun, 01 Jun 2008 12:04:26 GMT]]></title><description><![CDATA[<p>Hi!<br />
Ich habe die Nase voll von std::cout.setwXXX und was weiß ich noch! Ich brauche eine Bibliothek mit der Tabellen leicht zu erstellen sind. Eine html Ausgabe wäre ganz in Ordnung. Gibt es so was?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1520519</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1520519</guid><dc:creator><![CDATA[khalderon]]></dc:creator><pubDate>Sun, 01 Jun 2008 12:04:26 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Bibliothek, die Html Dateien generieren kann on Sun, 01 Jun 2008 12:15:44 GMT]]></title><description><![CDATA[<p>Wenns nur Tabellen sein sollen, dann schreib halt die paar td und tr selber in die Datei.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1520524</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1520524</guid><dc:creator><![CDATA[td]]></dc:creator><pubDate>Sun, 01 Jun 2008 12:15:44 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Bibliothek, die Html Dateien generieren kann on Sun, 01 Jun 2008 22:01:17 GMT]]></title><description><![CDATA[<p>Ich denke mal, <a href="http://de.wikipedia.org/wiki/CSV_(Dateiformat)" rel="nofollow">DAS</a> wird dir gefallen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Cheers!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1520826</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1520826</guid><dc:creator><![CDATA[==Fidelio==]]></dc:creator><pubDate>Sun, 01 Jun 2008 22:01:17 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Bibliothek, die Html Dateien generieren kann on Mon, 09 Jun 2008 13:03:23 GMT]]></title><description><![CDATA[<p>==Fidelio== schrieb:</p>
<blockquote>
<p>Ich denke mal, <a href="http://de.wikipedia.org/wiki/CSV_(Dateiformat)" rel="nofollow">DAS</a> wird dir gefallen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Cheers!</p>
</blockquote>
<p>Naja. Mit Open Office geht das. Aber mit Excel hab ich es noch nicht ausprobiert zu öffnen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1525724</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1525724</guid><dc:creator><![CDATA[khalderon]]></dc:creator><pubDate>Mon, 09 Jun 2008 13:03:23 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Bibliothek, die Html Dateien generieren kann on Mon, 09 Jun 2008 15:32:51 GMT]]></title><description><![CDATA[<p>khalderon schrieb:</p>
<blockquote>
<p>Naja. Mit Open Office geht das. Aber mit Excel hab ich es noch nicht ausprobiert zu öffnen...</p>
</blockquote>
<p>Sollte mit Excel funktionieren. Ist zwar nicht ganz so perfekt beim Öffnen von CSV-Dateien wie OpenOffice, aber hatte noch nie Probleme.</p>
<p>Aber wieso erstellst du dir nicht kurz eine kleine Bibliothek?</p>
<pre><code class="language-cpp">class CCell
{
    // Attributes //
private:
    std::string m_Value;

    // Methods //
public:
    void set_value_string(std::string Value) { m_Value = Value; };
    std::string const&amp; get_value_string() const { return m_Value; };

    template&lt;typename T&gt;
    void set_value(T Value) { m_Value = (std::stringstream() &lt;&lt; Value).str(); };
}

std::ostream operator &lt;&lt;(std::ostream&amp; rOutput, CCell const&amp; rCell)
{
    rOutput &lt;&lt; &quot;&lt;td&gt;&quot; &lt;&lt; rCell.get_value_string() &lt;&lt; &quot;&lt;/td&gt;&quot;;
    return rOutput;
}

class CRow
{
    // Attributes //
private:
    std::vector&lt;CCell&gt; m_CellVector;

    // ...
}

std::ostream operator &lt;&lt;(std::ostream&amp; rOutput, CRow const&amp; rRow)
{
    rOutput &lt;&lt; &quot;&lt;tr&gt;&quot; &lt;&lt; /* ... */ &lt;&lt; &quot;&lt;/tr&gt;&quot;;
    return rOutput;
}

class CTable
{
    // Attributes //
private:
    std::vector&lt;CRow&gt; m_RowVector;

    // ...
}

std::ostream operator &lt;&lt;(std::ostream&amp; rOutput, CTable const&amp; rTable)
{
    rOutput &lt;&lt; &quot;&lt;table&gt;&quot; &lt;&lt; /* ... */ &lt;&lt; &quot;&lt;/table&gt;&quot;;
    return rOutput;
}
</code></pre>
<p>Ich denke das Prinzip dürfte klar sein und in 30 Minuten hast du die paar Klassen fertig. Zudem ist es eine gute Übung <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1525808</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1525808</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Mon, 09 Jun 2008 15:32:51 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Bibliothek, die Html Dateien generieren kann on Mon, 09 Jun 2008 15:53:46 GMT]]></title><description><![CDATA[<p>Um HTML-Code generieren zu lassen kann ich dir auch die Boost HTML Library empfehlen:</p>
<pre><code class="language-cpp">document doc;
ptr_element_t table(new element(&quot;table&quot;));
ptr_element_t tr(new element(&quot;tr&quot;));
ptr_element_t td(new element(&quot;td&quot;));
td-&gt;setValue(&quot;Zelleninhalt&quot;);
tr-&gt;addChild(td);
table-&gt;addChild(tr)

doc.addChild(table)
cout &lt;&lt; doc.as_string() &lt;&lt; endl;
</code></pre>
<p>Mit etwas Übung (und ein paar eigenen Helper-Funktionen) kann man damit ganz einfach kleinere Webseiten basteln.</p>
<p>Greeetz Kessi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1525835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1525835</guid><dc:creator><![CDATA[KessiMC]]></dc:creator><pubDate>Mon, 09 Jun 2008 15:53:46 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Bibliothek, die Html Dateien generieren kann on Mon, 09 Jun 2008 19:29:30 GMT]]></title><description><![CDATA[<p>KessiMC schrieb:</p>
<blockquote>
<p>Um HTML-Code generieren zu lassen kann ich dir auch die Boost HTML Library empfehlen:</p>
<pre><code class="language-cpp">document doc;
ptr_element_t table(new element(&quot;table&quot;));
ptr_element_t tr(new element(&quot;tr&quot;));
ptr_element_t td(new element(&quot;td&quot;));
td-&gt;setValue(&quot;Zelleninhalt&quot;);
tr-&gt;addChild(td);
table-&gt;addChild(tr)

doc.addChild(table)
cout &lt;&lt; doc.as_string() &lt;&lt; endl;
</code></pre>
<p>Mit etwas Übung (und ein paar eigenen Helper-Funktionen) kann man damit ganz einfach kleinere Webseiten basteln.</p>
<p>Greeetz Kessi</p>
</blockquote>
<p>Hey! Ich wusste nicht dass es boost::html gibt. Wo ist das denn zu finden?<br />
Dravere, deine Vorgehensweise finde ich ganz gut, aber ich war mich zu faul um etwas selbstständig zu basteln.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1526021</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1526021</guid><dc:creator><![CDATA[khalderon]]></dc:creator><pubDate>Mon, 09 Jun 2008 19:29:30 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Bibliothek, die Html Dateien generieren kann on Tue, 10 Jun 2008 17:49:27 GMT]]></title><description><![CDATA[<p>Das wäre dann hier:<br />
<a href="http://www.ibusy.com/articles/software-development/boost-html-library.html" rel="nofollow">http://www.ibusy.com/articles/software-development/boost-html-library.html</a></p>
<p>Ist im normalen Boost-Paket nicht dabei, wird lediglich unter der Boost-Lizenz vertrieben.</p>
<p>greeetz<br />
Kessi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1526574</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1526574</guid><dc:creator><![CDATA[KessiMC]]></dc:creator><pubDate>Tue, 10 Jun 2008 17:49:27 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Bibliothek, die Html Dateien generieren kann on Sat, 14 Jun 2008 08:16:48 GMT]]></title><description><![CDATA[<p>Hallo wieder!<br />
Hab mir die Bibliothek selbst gebastelt.<br />
Man benutzt sie bspw. so:</p>
<pre><code class="language-cpp">#include &quot;html_table.hpp&quot;

int main()
{
	using namespace ZM::Html;
	Table t(&quot;testing&quot;);
	t.add_row()
		.add_heading(&quot;Column 1&quot;).add_heading(&quot;Days&quot;).add_heading(&quot;Balance&quot;);
	t.add_row()
		.add_cell(&quot;hi&quot;).add_cell(&quot;test&quot;).add_cell(&quot;okay&quot;);
	t.add_row()
		.add_cell(&quot;next&quot;).add_cell(23).add_cell(-32.032);
	t.add_row()
		.add_cell(&quot;this is a long cell...&quot;);
}
</code></pre>
<p>Daraus kriegt man eine html Datei, nämlich:</p>
<pre><code class="language-html">&lt;html&gt;
	&lt;head&gt;&lt;title&gt;testing&lt;/title&gt;&lt;/head&gt;
	&lt;body&gt;
		&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot;&gt;
			&lt;tr&gt;&lt;th&gt;Column 1&lt;/th&gt;&lt;th&gt;Days&lt;/th&gt;&lt;th&gt;Balance&lt;/th&gt;&lt;/tr&gt;
			&lt;tr&gt;&lt;td&gt;hi&lt;/td&gt;&lt;td&gt;test&lt;/td&gt;&lt;td&gt;okay&lt;/td&gt;&lt;/tr&gt;

			&lt;tr&gt;&lt;td&gt;next&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;-32.032&lt;/td&gt;&lt;/tr&gt;
			&lt;tr&gt;&lt;td&gt;this is a long cell...&lt;/td&gt;&lt;/tr&gt;
		&lt;/table&gt;
	&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p>Die Schnittstelle sieht so aus:</p>
<pre><code class="language-cpp">#ifndef GUARD_HTML_TABLE
#define GUARD_HTML_TABLE 1

namespace ZM
{

	namespace Html
	{

		class Table
		{
			struct impl;
			impl* pimpl;
			Table(const Table&amp;);
			Table&amp; operator=(const Table&amp;);

		public:
			Table(const char* name);
			~Table();

			class Row
			{
				friend class Table;
				Table&amp; t;
				Row(Table&amp;);

			public:
				~Row();
				class Cell
				{
					friend class Row;
					Row&amp; r;
					Cell(Row&amp;, const char*);
					Cell(Row&amp;, int);
					Cell(Row&amp;, double);
					~Cell();
				};

				class Heading
				{
					friend class Row;
					Row&amp; r;
					Heading(Row&amp;, const char*);
					~Heading();
				};

				Row&amp; add_heading(const char*);
				Row&amp; add_cell(const char*);
				Row&amp; add_cell(int);
				Row&amp; add_cell(double);
			};

			Row add_row();
		};

	}

}

#endif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1528784</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1528784</guid><dc:creator><![CDATA[khalderon]]></dc:creator><pubDate>Sat, 14 Jun 2008 08:16:48 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Bibliothek, die Html Dateien generieren kann on Sat, 14 Jun 2008 12:15:06 GMT]]></title><description><![CDATA[<p>khalderon schrieb:</p>
<blockquote>
<p>...</p>
</blockquote>
<p>Und wo genau liegt das Problem?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1528914</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1528914</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sat, 14 Jun 2008 12:15:06 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Bibliothek, die Html Dateien generieren kann on Sat, 14 Jun 2008 12:16:47 GMT]]></title><description><![CDATA[<p>drakon schrieb:</p>
<blockquote>
<p>Und wo genau liegt das Problem?</p>
</blockquote>
<p>Wahrscheinlich nirgends. Er/sie ist nur so vorbildlich und präsentiert die Lösung, falls jemand über die Forensuche wieder auf das Problem stösst <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1528916</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1528916</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Sat, 14 Jun 2008 12:16:47 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Bibliothek, die Html Dateien generieren kann on Sat, 14 Jun 2008 12:45:32 GMT]]></title><description><![CDATA[<p>Eine weitere gute Bibliothek zum Erstellen von HTML-Code ist cgicc: <a href="http://www.gnu.org/software/cgicc/" rel="nofollow">http://www.gnu.org/software/cgicc/</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1528940</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1528940</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Sat, 14 Jun 2008 12:45:32 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Bibliothek, die Html Dateien generieren kann on Wed, 25 Jun 2008 17:23:13 GMT]]></title><description><![CDATA[<p>leute,<br />
das gefreut mich das mein boost.html library in deutschland auch benutz ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1535793</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1535793</guid><dc:creator><![CDATA[SoftwareAce]]></dc:creator><pubDate>Wed, 25 Jun 2008 17:23:13 GMT</pubDate></item></channel></rss>