Skip to content

Commit

Permalink
add operator== and operator!= to pdal::Metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Mar 18, 2014
1 parent 920d59c commit ef7c1d2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/pdal/Metadata.hpp
Expand Up @@ -172,7 +172,7 @@ class PDAL_DLL Metadata
setDescription(description);
setValue<T>(value);
}


/// @name Adding Metadata members
/// Convenience addition
Expand Down Expand Up @@ -200,6 +200,11 @@ class PDAL_DLL Metadata
/// respective paths as defined by their dotted Metadata::getName() values
Metadata operator+(const Metadata& rhs) const;

bool operator==(Metadata const& rhs) const;
bool operator!=(Metadata const& rhs) const;
bool equal(Metadata const& rhs) const;


/** @name entry type
*/
/// @return the type for the metadata entry as a string. These
Expand Down
16 changes: 16 additions & 0 deletions src/Metadata.cpp
Expand Up @@ -82,6 +82,22 @@ Metadata Metadata::operator+(const Metadata& rhs) const

}

bool Metadata::equal(Metadata const& rhs) const
{
return m_tree == rhs.m_tree;
}


bool Metadata::operator==(Metadata const& rhs) const
{
return equal(rhs);
}

bool Metadata::operator!=(Metadata const& rhs) const
{
return !(equal(rhs));
}


} // namespace pdal

Expand Down

0 comments on commit ef7c1d2

Please sign in to comment.