Xport Interface: comment::comment
Constructor for comment
.
comment::comment(Standard constructor
const std::string& text
);
comment::comment( copy constructor
const comment& src
);
Parameters
text
A string which will be used as the text for the comment.
src
The comment object to be copied.
Remarks
The comment
constructor creates a comment object, and uses the passed text as the body of the comment.
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.begin();
++it; // now points to html element
doc.insert(it, comment("Sample xhtml document"));
doc.body()->insert(comment("The content of the document goes here."));
formatter fmtr(std::cout);
fmtr.option(max_line_length, 70);
doc.write(fmtr);
std::cout << "\n\n";
return 0;
}