Xport Interface: stylesheet_item::iterator::operator ->
Pointer operator for stylesheet_item::iterator and stylesheet_item::const_iterator.
declaration* stylesheet_item::iterator::operator ->() const; iterator
const declaration* stylesheet_item::const_iterator::operator ->() const; const_iterator
Parameters
None
Returns
Returns a pointer (or const pointer for const_iterator) to the underlying declaration.
Remarks
Returns a pointer to the underlying declaration (for iterator), and a const pointer to the declaration (for const_iterator).
Complexity
Constant
Example
#include "xhtml_doc.h"
#include <iostream>
int main(int argc, char* argv[])
{
using namespace Xport;
stylesheet ss;
ss << stylesheet_comment("Sample stylesheet\n-----------------------------");
stylesheet::iterator it = ss.insert(stylesheet_rule("h1"));
*it << declaration(css::color, "red")
<< declaration(text_align, "left")
<< declaration(padding_left, "5px")
<< declaration(margin_top, "10px");
stylesheet_formatter fmtr(std::cout);
fmtr << ss;
std::cout << "\n\nList the stylesheet items individually.\n\n";
stylesheet_item::const_iterator sit = it->begin();
for (; sit != it->end(); ++sit) {
std::cout << sit->property_name() << ": " << sit->value() <<
"\n";
}
std::cout << "\n\n";
}