Commit 6c78bb40 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2053] Make LabelSequence::toText(bool) a private method

parent b945fd1c
...@@ -41,6 +41,9 @@ namespace dns { ...@@ -41,6 +41,9 @@ namespace dns {
/// data of the associated Name object). /// data of the associated Name object).
/// ///
class LabelSequence { class LabelSequence {
// Name calls the private toText(bool) method of LabelSequence.
friend std::string Name::toText(bool) const;
public: public:
/// \brief Constructs a LabelSequence for the given name /// \brief Constructs a LabelSequence for the given name
/// ///
...@@ -127,7 +130,7 @@ public: ...@@ -127,7 +130,7 @@ public:
/// ///
/// This method returns a <code>std::string</code> object representing the /// This method returns a <code>std::string</code> object representing the
/// LabelSequence as a string. The returned string ends with a dot /// LabelSequence as a string. The returned string ends with a dot
/// '.' if <code>omit_final_dot</code> is <code>false</code>. /// '.' if the label sequence is absolute.
/// ///
/// This function assumes the underlying name is in proper /// This function assumes the underlying name is in proper
/// uncompressed wire format. If it finds an unexpected label /// uncompressed wire format. If it finds an unexpected label
...@@ -136,26 +139,22 @@ public: ...@@ -136,26 +139,22 @@ public:
/// allocation for the result string fails, a corresponding standard /// allocation for the result string fails, a corresponding standard
/// exception will be thrown. /// exception will be thrown.
// //
/// \param omit_final_dot whether to omit the trailing dot in the output.
/// \return a string representation of the <code>LabelSequence</code>. /// \return a string representation of the <code>LabelSequence</code>.
std::string toText(bool omit_final_dot) const; std::string toText() const;
private:
/// \brief Convert the LabelSequence to a string. /// \brief Convert the LabelSequence to a string.
/// ///
/// This method returns a <code>std::string</code> object representing the /// This method is a version of the zero-argument toText() method,
/// LabelSequence as a string. The returned string ends with a dot /// that accepts a <code>omit_final_dot</code> argument. The
/// '.' if the label sequence is absolute. /// returned string ends with a dot '.' if
/// <code>omit_final_dot</code> is <code>false</code>.
/// ///
/// This function assumes the underlying name is in proper /// \param omit_final_dot whether to omit the trailing dot in the output.
/// uncompressed wire format. If it finds an unexpected label
/// character including compression pointer, an exception of class
/// \c BadLabelType will be thrown. In addition, if resource
/// allocation for the result string fails, a corresponding standard
/// exception will be thrown.
//
/// \return a string representation of the <code>LabelSequence</code>. /// \return a string representation of the <code>LabelSequence</code>.
std::string toText() const; std::string toText(bool omit_final_dot) const;
public:
/// \brief Calculate a simple hash for the label sequence. /// \brief Calculate a simple hash for the label sequence.
/// ///
/// This method calculates a hash value for the label sequence as binary /// This method calculates a hash value for the label sequence as binary
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment