aboutsummaryrefslogtreecommitdiffstats
path: root/src/messageId.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2004-10-21 15:05:47 +0000
committerVincent Richard <[email protected]>2004-10-21 15:05:47 +0000
commit2949fb51f13e1236d5c161f02e1c2c8541100e9f (patch)
tree991edcf50483116ce83977a4d9e652de8c5328dc /src/messageId.cpp
parentheader class unit tests added (diff)
downloadvmime-2949fb51f13e1236d5c161f02e1c2c8541100e9f.tar.gz
vmime-2949fb51f13e1236d5c161f02e1c2c8541100e9f.zip
Refactoring (see ChangeLog).
Diffstat (limited to 'src/messageId.cpp')
-rw-r--r--src/messageId.cpp70
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