Xport Interface: stylesheet_item::iterator::operator --
Decrement operator for stylesheet_item::iterator, and stylesheet_item::const_iterator.
stylesheet_item::iterator& stylesheet_item::iterator::operator --(); non-const pre-increment
stylesheet_item::iterator stylesheet_item::iterator::operator --(int); non-const post-increment
stylesheet_item::const_iterator& stylesheet_item::const_iterator::operator --() const; const pre-increment
stylesheet_item::const_iterator stylesheet_item::const_iterator::operator --(int) const; const post-increment
Parameters
None
Remarks
Decrement operator for stylesheet_item::iterator and stylesheet_item::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_rule("h1")
<< 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 in reverse.\n\n";
stylesheet::iterator it = ss.begin();
++it;
assert(it->selector() == "h1");
stylesheet_item::iterator sit = it->end();
do {
--sit;
std::cout << sit->property_name() << ": " << sit->value() << "\n";
} while (sit != it->begin());
std::cout << "\n\n";
}