os_text
|
 |
Text that requires encoding.
An os_text
is text that is encoded during conversion to HTML. This differs from os_literal
.
The four special characters <,
>, &, and ", are automatically converted to HTML character entity
references. The content of os_text can be specified
in a constructor or through operator= .
Many interfaces that accept a const
os_element& element reference also provide a form that accepts const
string& . In most cases, an os_text is automatically created from the
specified string, so it is unnecessary to create an os_text explicitly.
Declaration
#include <ospace/web/text.h>
class os_text : public os_element
Interface
Constructor
os_text()
Constructs an empty text
element.
Constructor
os_text(
const string& text )
Constructs a text element
containing a copy of text .
Constructor
os_text(
const os_text& rhs )
Constructs a text element
that is a copy of rhs .
Destructor
/*
virtual */ ~os_text()
Destroys the text element.
=
os_text&
operator=( const os_text& rhs )
Replaces the text element
contents with a copy of rhs .
=
os_text&
operator=( const string& rhs )
Replaces the text element
contents with a copy of rhs .
string
operator
string() const
Converts the text element
to a string .
clone
/*
virtual */ os_element* clone() const
Returns a base class
pointer to a heap-based deep copy of the text element.
print
/*
virtual */ void print( ostream& os )
const
Prints the text element to
os .
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved