From 2949fb51f13e1236d5c161f02e1c2c8541100e9f Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 21 Oct 2004 15:05:47 +0000 Subject: Refactoring (see ChangeLog). --- src/messageId.cpp | 70 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 13 deletions(-) (limited to 'src/messageId.cpp') diff --git a/src/messageId.cpp b/src/messageId.cpp index 1ea99d1f..666136f5 100644 --- a/src/messageId.cpp +++ b/src/messageId.cpp @@ -127,7 +127,7 @@ void messageId::parse(const string& buffer, const string::size_type position, } -const string messageId::id() const +const string messageId::getId() const { return (m_left + '@' + m_right); } @@ -143,14 +143,6 @@ void messageId::generate(utility::outputStream& os, const string::size_type /* m } -messageId& messageId::operator=(const messageId& source) -{ - m_left = source.m_left; - m_right = source.m_right; - return (*this); -} - - messageId& messageId::operator=(const string& id) { parse(id); @@ -164,12 +156,12 @@ messageId messageId::generateId() left << "vmime"; left << '.'; - left << std::hex << utility::random::time(); + left << std::hex << utility::random::getTime(); left << '.'; - left << std::hex << utility::random::process(); + left << std::hex << utility::random::getProcess(); left << '.'; - left << std::hex << utility::random::next(); - left << std::hex << utility::random::next(); + left << std::hex << utility::random::getNext(); + left << std::hex << utility::random::getNext(); return (messageId(left.str(), platformDependant::getHandler()->getHostName())); } @@ -181,4 +173,56 @@ const bool messageId::operator==(const messageId& mid) const } +const bool messageId::operator!=(const messageId& mid) const +{ + return !(*this == mid); +} + + +messageId* messageId::clone() const +{ + return new messageId(*this); +} + + +void messageId::copyFrom(const component& other) +{ + const messageId& mid = dynamic_cast (other); + + m_left = mid.m_left; + m_right = mid.m_right; +} + + +messageId& messageId::operator=(const messageId& other) +{ + copyFrom(other); + return (*this); +} + + +const string& messageId::getLeft() const +{ + return (m_left); +} + + +void messageId::setLeft(const string& left) +{ + m_left = left; +} + + +const string& messageId::getRight() const +{ + return (m_right); +} + + +void messageId::setRight(const string& right) +{ + m_right = right; +} + + } // vmime -- cgit v1.2.3