Note that there are some explanatory texts on larger screens.

plurals
  1. POGet the source code from an html file
    primarykey
    data
    text
    <p>I am wondering if you could please help with generating .cpp/.h file from the following html file in a programmatic way (using whatever scripting language, or programming language, or even using editors such as vi or emacs):</p> <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"&gt; &lt;head&gt; &lt;title&gt;Class&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt; &lt;/head&gt; &lt;body link="blue" vlink="purple" bgcolor="#FFFABB" text="black"&gt; &lt;h2&gt;&lt;font face="Helvetica"&gt;Code Fragment: Class&lt;/font&gt;&lt;/h2&gt; &lt;/center&gt;&lt;br&gt;&lt;dl&gt;&lt;dd&gt;&lt;pre&gt; &lt;font color=#A000A0&gt;template&lt;/font&gt; &amp;lt;&lt;font color=#A000A0&gt;typename&lt;/font&gt; G&amp;gt; &lt;font color=#A000A0&gt;class&lt;/font&gt; Components : &lt;font color=#A000A0&gt;public&lt;/font&gt; DFS&amp;lt;G&amp;gt; { &lt;font color=#0000FF&gt;// count components&lt;/font&gt; &lt;font color=#A000A0&gt;private&lt;/font&gt;: &lt;font color=#A000A0&gt;int&lt;/font&gt; nComponents; &lt;font color=#0000FF&gt;// num of components&lt;/font&gt; &lt;font color=#A000A0&gt;public&lt;/font&gt;: &lt;font color=#000000&gt;Components&lt;/font&gt;(&lt;font color=#A000A0&gt;const&lt;/font&gt; G&amp; g): DFS&amp;lt;G&amp;gt;(g) {} &lt;font color=#0000FF&gt;// constructor&lt;/font&gt; &lt;font color=#A000A0&gt;int&lt;/font&gt; &lt;font color=#A000A0&gt;operator&lt;/font&gt;()(); &lt;font color=#0000FF&gt;// count components&lt;/font&gt; }; &lt;/dl&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>If you could please point out how this was done in the other direction too, that would be great. Thanks a lot.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload