Xport Interface: pcdata::operator <<
Inserts PCDATA in the called pcdata
object.
virtual markup& pcdata::operator<<(
const std::string& pcdat
);
Parameters
pcdat
A string argument which represents PCDATA to insert as content.
Returns
Returns a reference to the pcdata's
base class, markup
. This allows the chaining of the operation, which is most useful
when inserting PCDATA multiple times.
Remarks
This operation inserts PCDATA into the called pcdata
object. The passed PCDATA is inserted at the end of any PCDATA which may be
present in the pcdata
object.
Complexity
Constant
Example
#include "xhtml_doc.h"
#include <iostream>
int main(int argc, char* argv[])
{
using namespace Xport;
document doc(root_doc);
markup::iterator it = doc.body()->insert(element(p));
*it << "This is the first paragraph in the document.";
it->front() << "All the text in this document is contained in a single pcdata object, ";
it->front() << "as opposed to multiple pcdata objects in the paragraph.";
formatter fmtr(std::cout);
fmtr.option(max_line_length, 60);
doc.write(fmtr);
std::cout << "\n\n";
std::cout << "The paragraph element in the document above contains " << it->size() << " pcdata object(s).\n";
return 0;
}