summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/verify.cc23
-rw-r--r--src/verify.h1
2 files changed, 24 insertions, 0 deletions
diff --git a/src/verify.cc b/src/verify.cc
index 7948767a..623794cc 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -1618,6 +1618,29 @@ dcp::operator== (dcp::VerificationNote const& a, dcp::VerificationNote const& b)
}
+bool
+dcp::operator< (dcp::VerificationNote const& a, dcp::VerificationNote const& b)
+{
+ if (a.type() != b.type()) {
+ return a.type() < b.type();
+ }
+
+ if (a.code() != b.code()) {
+ return a.code() < b.code();
+ }
+
+ if (a.note() != b.note()) {
+ return a.note().get_value_or("") < b.note().get_value_or("");
+ }
+
+ if (a.file() != b.file()) {
+ return a.file().get_value_or("") < b.file().get_value_or("");
+ }
+
+ return a.line().get_value_or(0) < b.line().get_value_or(0);
+}
+
+
std::ostream&
dcp::operator<< (std::ostream& s, dcp::VerificationNote const& note)
{
diff --git a/src/verify.h b/src/verify.h
index 08be77c6..372da764 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -455,6 +455,7 @@ std::vector<VerificationNote> verify (
std::string note_to_string (dcp::VerificationNote note);
bool operator== (dcp::VerificationNote const& a, dcp::VerificationNote const& b);
+bool operator< (dcp::VerificationNote const& a, dcp::VerificationNote const& b);
std::ostream& operator<<(std::ostream& s, dcp::VerificationNote const& note);