diff options
author | Vincent Richard <[email protected]> | 2004-10-21 15:05:47 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2004-10-21 15:05:47 +0000 |
commit | 2949fb51f13e1236d5c161f02e1c2c8541100e9f (patch) | |
tree | 991edcf50483116ce83977a4d9e652de8c5328dc /src/messageId.cpp | |
parent | header class unit tests added (diff) | |
download | vmime-2949fb51f13e1236d5c161f02e1c2c8541100e9f.tar.gz vmime-2949fb51f13e1236d5c161f02e1c2c8541100e9f.zip |
Refactoring (see ChangeLog).
Diffstat (limited to 'src/messageId.cpp')
-rw-r--r-- | src/messageId.cpp | 70 |
1 files changed, 57 insertions, 13 deletions
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 <const messageId&>(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 |