summaryrefslogtreecommitdiffstats
path: root/src/lib/dns/labelsequence.h
diff options
context:
space:
mode:
authorMukund Sivaraman <muks@isc.org>2012-07-12 05:58:00 +0200
committerMukund Sivaraman <muks@isc.org>2012-07-12 05:58:00 +0200
commita16d2686dc4f3ed114b3c43bec1c940b013e4998 (patch)
tree52435a275487e12014d0431c67cd808e2b48f117 /src/lib/dns/labelsequence.h
parent[2087] Change alignment of test data (diff)
downloadkea-a16d2686dc4f3ed114b3c43bec1c940b013e4998.tar.xz
kea-a16d2686dc4f3ed114b3c43bec1c940b013e4998.zip
[2087] Add MessageRenderer::writeName() variant for LabelSequence
The Name tests are not repeated as the Name variant is a wrapper around the LabelSequence variant. Such tests would be redundant. Instead, tests for LabelSequence specific stripLeft(), stripRight() were added.
Diffstat (limited to 'src/lib/dns/labelsequence.h')
-rw-r--r--src/lib/dns/labelsequence.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/dns/labelsequence.h b/src/lib/dns/labelsequence.h
index 019250e72c..398c9afad9 100644
--- a/src/lib/dns/labelsequence.h
+++ b/src/lib/dns/labelsequence.h
@@ -45,6 +45,23 @@ class LabelSequence {
friend std::string Name::toText(bool) const;
public:
+ /// \brief Constructs a LabelSequence for the given label sequence
+ ///
+ /// \note The associated data MUST remain in scope during the lifetime
+ /// of this LabelSequence, since only the pointers are copied.
+ ///
+ /// \note No validation is done on the given data upon construction;
+ /// use with care.
+ ///
+ /// \param ls The LabelSequence to construct a LabelSequence from
+ explicit LabelSequence(const LabelSequence& ls):
+ data_(ls.data_),
+ offsets_(ls.offsets_),
+ offsets_size_(ls.offsets_size_),
+ first_label_(ls.first_label_),
+ last_label_(ls.last_label_)
+ {}
+
/// \brief Constructs a LabelSequence for the given name
///
/// \note The associated Name MUST remain in scope during the lifetime