|
htmlHead
Page head class | [Previous] [Main] [Next] |
| htmlHead encapsulates the page <HEAD></HEAD> tags. It is used internally by the htmlPage class, which provides the htmlPage::Head() method for direct access, so it's not normally necessary to instantiate htmlHead objects directly.
| |
|
| |
| The <HEAD> tag area of a page contains descriptive infromation about the document, such as the title. It can also contain other attributes, such as <META> information often used to describe document contents for search engines.
| |
|
| |
| When rendered with a browser, the document title doesn't actually appear in the document itself. Instead, the title appears in a separate area in the browser's program area, typically as a window caption. Only one title is allowed per document, and it's length should be less than 64 characters in order to display properly on most browsers. The title may not contain paragraph tags or highlighting of any kind.
| |
|
| |
| #include <dcmicro/htmlpp/head.h>
| |
|
| |
| |
|
| |
| htmlPage, htmlBody, htmlMeta
| |
|
| |
| None.
| |
|
| |
| htmlHead()
| |
| Constructs an empty head object.
| |
|
| |
| htmlHead( const String& title )
| |
| Constructs a head object, setting the page title to title.
| |
|
| |
| htmlHead( const htmlHead& rhs )
| |
| Copy constructor.
| |
|
| |
| virtual ~htmlHead()
| |
| Destroys the object.
| |
|
| |
| = | htmlHead& operator= ( const htmlHead& rhs )
| |
| Replaces the contents with rhs and returns a pointer to the object.
| |
|
| |
| Title | htmlHead& Title( const String& title )
| |
| Sets the title to title, then returns a reference to the object.
| |
|
| |
| Title | String Title() const
| |
| Returns the title as a string.
| |
|
| |
| void Print( ostream& os ) const
| ||
| Outputs the object to os.
| |
|
| |
| Clone | htmlObject FAR * Clone() const
| |
| Returns a base-class pointer to a deep copy of the object.
| |
|
| |
|
| |
| #include <stdio.h>
| |
| #include <stdlib.h>
| |
| #include <dcmicro/htmlpp/htmlpp.h>
| |
|
| |
| int main( void )
| |
| {
| |
| htmlCgi server ;
| |
| htmlPage page( "html++ example application" ) ;
| |
|
| |
| // Create a meta information object
| |
| // containing a description of the document.
| |
| htmlMeta m ;
| |
| m.Description( "Descriptions placed here can be "
| |
| "used by search engines to identify "
| |
| "and index your pages." ) ;
| |
|
| |
| // Meta information objects must be placed
| |
| // in the head area of the page.
| |
| page.Head() << m ;
| |
|
| |
| page << "Meta information in the <HEAD> section "
| |
| "does not display, but can be seen "
| |
| "by search engines." ;
| |
|
| |
| server << page ;
| |
| return 0 ;
| |
| }
| |
|
| |
|
| |
| Content-Type: text/html
| |
| <HTML>
| |
| <HEAD>
| |
| <TITLE>html++ example application</TITLE>
| |
| <META name="description" content="Descriptions placed here can be used by search engines to identify and index your pages.">
| |
| </HEAD>
| |
| <BODY>
| |
| Meta information in the <HEAD> section does not display, but can be seen by search engines.
| |
| </BODY>
| |
| </HTML>
| |
|
| |
| |
|
| |
|
| |
