pdfobjects::utils::PropertyEquals Class Reference

#include <cobjecthelpers.h>

List of all members.

Public Member Functions

bool operator() (const boost::shared_ptr< IProperty > &val1, const boost::shared_ptr< IProperty > &val2) const

Detailed Description

Equality functor for properties.

Class with function operator to compare two properties. Class can be used as normal function.


Member Function Documentation

bool pdfobjects::utils::PropertyEquals::operator() ( const boost::shared_ptr< IProperty > &  val1,
const boost::shared_ptr< IProperty > &  val2 
) const

Equality function operator.

Parameters:
val1 Value to compare (with T type wrapped by smart poiter).
val2 Value to compare (with T type wrapped by smart poiter).

Two values are equal iff they:

  • have same types (getType returns same value)
    same values
  • if value is simple - direct values are same (getValue is used)
  • if value is complex - same number of elements and elements with same identifier are equal

Supported types

  • pNull
  • pBool
  • pInt
  • pReal
  • pString
  • pName
  • pRef
Exceptions:
NotImplementedException if value type is not supported (see supported types table).
Returns:
true if values are equal, false otherwise.

References pdfobjects::pBool, pdfobjects::pInt, pdfobjects::pName, pdfobjects::pNull, pdfobjects::pReal, pdfobjects::pRef, and pdfobjects::pString.


The documentation for this class was generated from the following files: