htmlComment
HTML Comment class
[Previous] [Main] [Next]


Description
htmlComment encapsulates HTML comment codes (e.g., <!-- ... -->). Comments are not displayed by web browsers, and are used to mark or otherwise add additional information important to the document's author. Comments are also often used by web servers to invoke server side includes.  
 
Declaration
#include <dcmicro/htmlpp/comment.h>  
 
Hierarchy
htmlcomment.gif  
 
See Also
None.  
 
Related Constants/Definitions
None.  
 
Constructors
htmlComment()  
Constructs an empty object.  
 
htmlComment( const String& text )  
Constructs an object, inserting the string text into it.  
 
htmlComment( const htmlComment& rhs )  
Copy constructor.  
 
Destructors
virtual ~htmlComment()  
Destroys the object.  
 
Member Methods
=   htmlComment& operator= ( const htmlComment& rhs )  
Replaces object contents with rhs, and returns a reference to it.  
 
=   htmlComment& operator= ( const String& text )  
Replaces object contents with text, and returns a reference to it.  
 
<<   htmlComment& operator<< (const String& text )  
Appends text, then returns a reference to the object.  
 
Stringoperator String() const  
Convert the object contents and return them as a string.  
 
Print   void Print( ostream& os ) const  
Outputs the object to os.  
 
ClonehtmlObject FAR * Clone() const  
Returns a base-class pointer to a deep copy of the object.  
 
Example Use
 
#include <stdio.h>  
#include <stdlib.h>  
#include <dcmicro/htmlpp/htmlpp.h>  
 
int main( void )  
{  
   htmlCgi   server ;  
   htmlPage  page( "html++ example application" ) ;  
 
   //  Comments are included in the HTML output,  
   //  but are not displayed by browsers.  
   page << htmlComment( "This is a test document" ) ;  
 
   server << page ;  
   return 0 ;  
}  
 
Program Output
 
Content-Type: text/html  
<HTML>  
<HEAD>  
<TITLE>html++ example application</TITLE>  
</HEAD>  
<BODY>  
<!--This is a test document-->  
</BODY>  
</HTML>  
 
 
 


©1998 DC Micro Development. All rights reserved.
No portion of this document may be c opied or reproduced without expressed written consent.
html++ is a trademark of DC Micro Development.