Xport Interface: stylesheet::iterator::operator --
Decrement operator for stylesheet::iterator, and stylesheet::const_iterator.
stylesheet::iterator& stylesheet::iterator::operator --(); non-const pre-increment
stylesheet::iterator stylesheet::iterator::operator --(int); non-const post-increment
stylesheet::const_iterator& stylesheet::const_iterator::operator --() const; const pre-increment
stylesheet::const_iterator stylesheet::const_iterator::operator --(int) const; const post-increment
Parameters
None
Remarks
Decrement operator for stylesheet::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, "center"))
<< (stylesheet_rule("p") << declaration(padding_left, "5px") << declaration(margin_top, "10px"))
<< (stylesheet_rule("#footer") << declaration(css::height, "50px") << declaration(css::border, "thin solid green"));
stylesheet_formatter fmtr(std::cout);
fmtr << ss;
std::cout << "\n\nList the stylesheet items individually in reverse.\n\n";
stylesheet::const_iterator it = ss.end();
do {
--it;
fmtr << *it;
} while (it != ss.begin());
std::cout << "\n\n";
}