summaryrefslogtreecommitdiffstats
path: root/src/lib/dns/name.h
diff options
context:
space:
mode:
authorMukund Sivaraman <muks@isc.org>2012-06-25 00:06:44 +0200
committerMukund Sivaraman <muks@isc.org>2012-06-25 00:06:44 +0200
commit57c61f2f457ac99686706d05dda5cd39737c6bd0 (patch)
treeb76eee174d2754852567df3b84d3e937a4b05bfe /src/lib/dns/name.h
parent[master] renamed file name 'NOTES’to more specific one for its content. (diff)
downloadkea-57c61f2f457ac99686706d05dda5cd39737c6bd0.tar.xz
kea-57c61f2f457ac99686706d05dda5cd39737c6bd0.zip
[2052] Add implementation and unit tests for dns::LabelSequence::compare()
Diffstat (limited to 'src/lib/dns/name.h')
-rw-r--r--src/lib/dns/name.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/lib/dns/name.h b/src/lib/dns/name.h
index ef32f90d7b..4e7564f4f9 100644
--- a/src/lib/dns/name.h
+++ b/src/lib/dns/name.h
@@ -142,7 +142,8 @@ public:
SUPERDOMAIN = 0,
SUBDOMAIN = 1,
EQUAL = 2,
- COMMONANCESTOR = 3
+ COMMONANCESTOR = 3,
+ NONE = 4
};
///
@@ -399,6 +400,29 @@ public:
/// comparison result.
NameComparisonResult compare(const Name& other) const;
+private:
+ /// \brief Partially compare two <code>Name</code>s.
+ ///
+ /// This method performs a partial comparison of the
+ /// <code>Name</code> and <code>other</code> and returns the result
+ /// in the form of a <code>NameComparisonResult</code> object.
+ ///
+ /// This method never throws an exception.
+ ///
+ /// \param other the right-hand operand to compare against.
+ /// \param first_label the leftmost label of <code>Name</code> to
+ /// begin comparing from.
+ /// \param first_label_other the leftmost label of
+ /// <code>other</code> to begin comparing from.
+ /// \param case_sensitive If true, comparison is case-insensitive
+ /// \return a <code>NameComparisonResult</code> object representing the
+ /// comparison result.
+ NameComparisonResult partial_compare(const Name& other,
+ unsigned int first_label,
+ unsigned int first_label_other,
+ bool case_sensitive = false) const;
+
+public:
/// \brief Return true iff two names are equal.
///
/// Semantically this could be implemented based on the result of the