diff options
author | Vincent Richard <[email protected]> | 2004-12-21 09:04:19 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2004-12-21 09:04:19 +0000 |
commit | 706c270073daeb2b303ab34b7c5c9862da62b1ae (patch) | |
tree | cc081dd5ac849d27ea825b6ddc958c76818ab24a /src/messaging/maildirUtils.cpp | |
parent | Added component::getChildComponents() function. (diff) | |
download | vmime-706c270073daeb2b303ab34b7c5c9862da62b1ae.tar.gz vmime-706c270073daeb2b303ab34b7c5c9862da62b1ae.zip |
Fixed ',2' in filename/flags + fixed file renaming when moving from 'new' to 'cur' + new functions random::getString() and maildirUtils::generateId().
Diffstat (limited to 'src/messaging/maildirUtils.cpp')
-rw-r--r-- | src/messaging/maildirUtils.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/messaging/maildirUtils.cpp b/src/messaging/maildirUtils.cpp index e620ce0a..aba91372 100644 --- a/src/messaging/maildirUtils.cpp +++ b/src/messaging/maildirUtils.cpp @@ -20,6 +20,8 @@ #include "maildirUtils.hpp" #include "maildirStore.hpp" +#include "../utility/random.hpp" + namespace vmime { namespace messaging { @@ -125,7 +127,9 @@ const int maildirUtils::extractFlags(const utility::file::path::component& comp) const utility::file::path::component maildirUtils::buildFlags(const int flags) { string str; - str.reserve(6); + str.reserve(8); + + str += "2,"; if (flags & message::FLAG_MARKED) str += "F"; if (flags & message::FLAG_PASSED) str += "P"; @@ -151,6 +155,20 @@ const utility::file::path::component maildirUtils::buildFilename } +const utility::file::path::component maildirUtils::generateId() +{ + std::ostringstream oss; + + oss << utility::random::getTime(); + oss << "."; + oss << utility::random::getProcess(); + oss << "."; + oss << utility::random::getString(6); + + return (utility::file::path::component(oss.str())); +} + + // // messageIdComparator |