Skip to content

Commit

Permalink
Add OID::operator> for PEM Pack
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Feb 7, 2024
1 parent 442d9ee commit 782057f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions asn.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ class CRYPTOPP_DLL OID
protected:
friend bool operator==(const OID &lhs, const OID &rhs);
friend bool operator!=(const OID &lhs, const OID &rhs);
friend bool operator<(const OID &lhs, const OID &rhs);
friend bool operator< (const OID &lhs, const OID &rhs);
friend bool operator> (const OID &lhs, const OID &rhs);
friend bool operator<=(const OID &lhs, const OID &rhs);
friend bool operator>=(const OID &lhs, const OID &rhs);

Expand Down Expand Up @@ -913,11 +914,18 @@ inline bool operator!=(const OID &lhs, const OID &rhs);
/// \param lhs the first OID
/// \param rhs the second OID
/// \return true if the first OID is less than the second OID, false otherwise
/// \details operator<() calls std::lexicographical_compare() on each element in the array of values.
/// \details operator<() calls std::lexicographical_compare() on the values.
inline bool operator<(const OID &lhs, const OID &rhs);
/// \brief Compare two OIDs for ordering
/// \param lhs the first OID
/// \param rhs the second OID
/// \return true if the first OID is greater than the second OID, false otherwise
/// \details operator>() is implemented in terms of operator==() and operator<().
/// \since Crypto++ 8.3
inline bool operator>(const OID &lhs, const OID &rhs);
/// \brief Compare two OIDs for ordering
/// \param lhs the first OID
/// \param rhs the second OID
/// \return true if the first OID is less than or equal to the second OID, false otherwise
/// \details operator<=() is implemented in terms of operator==() and operator<().
/// \since Crypto++ 8.3
Expand All @@ -944,6 +952,8 @@ inline bool operator!=(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
{return lhs.m_values != rhs.m_values;}
inline bool operator<(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
{return std::lexicographical_compare(lhs.m_values.begin(), lhs.m_values.end(), rhs.m_values.begin(), rhs.m_values.end());}
inline bool operator>(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
{return ! (lhs<rhs || lhs==rhs);}
inline bool operator<=(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
{return lhs<rhs || lhs==rhs;}
inline bool operator>=(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
Expand Down

0 comments on commit 782057f

Please sign in to comment.