Commit 2c34181a authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[2098] some additional changes to making writeName virtual in the base class.

parent b350749a
...@@ -42,6 +42,7 @@ public: ...@@ -42,6 +42,7 @@ public:
virtual void setCompressMode(CompressMode mode); virtual void setCompressMode(CompressMode mode);
virtual void clear(); virtual void clear();
virtual void writeName(const Name& name, bool compress = true); virtual void writeName(const Name& name, bool compress = true);
virtual void writeName(const LabelSequence& labels, bool compress);
private: private:
struct MessageRendererImpl; struct MessageRendererImpl;
MessageRendererImpl* impl_; MessageRendererImpl* impl_;
......
...@@ -332,8 +332,20 @@ public: ...@@ -332,8 +332,20 @@ public:
/// for compressing subsequent names. /// for compressing subsequent names.
/// ///
/// \param name A \c Name object to be written. /// \param name A \c Name object to be written.
/// \param compress A boolean indicating whether to enable name compression. /// \param compress A boolean indicating whether to enable name
/// compression.
virtual void writeName(const Name& name, bool compress = true) = 0; virtual void writeName(const Name& name, bool compress = true) = 0;
/// \brief Write a \c LabelSequence object into the internal buffer
/// in wire format, with or without name compression.
///
/// This is the same as the other version, which takes \c Name instead
/// of \c LabelSequence, except for the parameter type. The passed
/// \c LabelSequence must be absolute.
///
/// \param ls A \c LabelSequence object to be written.
/// \param compress A boolean indicating whether to enable name
/// compression.
virtual void writeName(const LabelSequence& ls, bool compress = true) = 0; virtual void writeName(const LabelSequence& ls, bool compress = true) = 0;
//@} //@}
}; };
...@@ -377,21 +389,6 @@ public: ...@@ -377,21 +389,6 @@ public:
virtual void clear(); virtual void clear();
virtual void writeName(const Name& name, bool compress = true); virtual void writeName(const Name& name, bool compress = true);
/// \brief Write a \c LabelSequence object into the internal buffer
/// in wire format, with or without name compression.
///
/// If the optional parameter \c compress is \c true, this method tries to
/// compress the \c ls if possible, searching the entire message that has
/// been rendered. Otherwise name compression is omitted. Its default
/// value is \c true.
///
/// Note: even if \c compress is \c true, the position of the \c ls (and
/// possibly its ancestor names) in the message is recorded and may be used
/// for compressing subsequent names.
///
/// \param ls A \c LabelSequence object to be written.
/// \param compress A boolean indicating whether to enable name compression.
virtual void writeName(const LabelSequence& ls, bool compress = true); virtual void writeName(const LabelSequence& ls, bool compress = true);
private: private:
......
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