Xport Interface: stylesheet_item::iterator::operator ==, !=
Equality and inequality operators for stylesheet_item::iterator and stylesheet_item::const_iterator.
bool operator ==(const stylesheet_item::const_iterator& lhs, const stylesheet_item::const_iterator& rhs);
bool operator !=(const stylesheet_item::const_iterator& lhs, const stylesheet_item::const_iterator& rhs);
Parameters
lhs
The left iterator to compare.
rhs
The right iterator to compare.
Returns
Returns true if the stylesheet item iterators point to the
same declaration.
Remarks
Test two stylesheet_item iterators for equality or inequality. These operation are not a member function, so they allow the conversion of iterator to
const_iterator for both the left and right arguments.
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.\n\n";
stylesheet::iterator it = ss.begin();
++it;
assert(it->selector() == "h1");
stylesheet_item::const_iterator sit = it->begin();
for (; sit != it->end(); ++sit) {
std::cout << sit->property_name() << ": " << sit->value() << "\n";
}
std::cout << "\n\n";
}