ToString method to Packet
This commit is contained in:
@@ -412,6 +412,14 @@ Packet::PrintByteTags (std::ostream &os) const
|
||||
}
|
||||
}
|
||||
|
||||
std::string
|
||||
Packet::ToString() const
|
||||
{
|
||||
std::ostringstream oss;
|
||||
Print (oss);
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
void
|
||||
Packet::Print (std::ostream &os) const
|
||||
{
|
||||
|
||||
@@ -453,6 +453,15 @@ public:
|
||||
*/
|
||||
void Print (std::ostream &os) const;
|
||||
|
||||
/**
|
||||
* \brief Return a string representation of the packet
|
||||
*
|
||||
* An empty string is returned if you haven't called EnablePrinting ()
|
||||
*
|
||||
* \return String representation
|
||||
*/
|
||||
std::string ToString (void) const;
|
||||
|
||||
/**
|
||||
* \brief Returns an iterator which points to the first 'item'
|
||||
* stored in this buffer.
|
||||
|
||||
Reference in New Issue
Block a user