Added function to return email address as a string.
This commit is contained in:
parent
abf7dec38b
commit
d65d02cf09
@ -26,6 +26,7 @@
|
|||||||
#include "vmime/platform.hpp"
|
#include "vmime/platform.hpp"
|
||||||
|
|
||||||
#include "vmime/parserHelpers.hpp"
|
#include "vmime/parserHelpers.hpp"
|
||||||
|
#include "vmime/utility/outputStreamAdapter.hpp"
|
||||||
#include "vmime/utility/outputStreamStringAdapter.hpp"
|
#include "vmime/utility/outputStreamStringAdapter.hpp"
|
||||||
#include "vmime/utility/stringUtils.hpp"
|
#include "vmime/utility/stringUtils.hpp"
|
||||||
|
|
||||||
@ -510,4 +511,18 @@ bool emailAddress::isEmpty() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const string emailAddress::toString() const
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
utility::outputStreamAdapter adapter(oss);
|
||||||
|
|
||||||
|
generationContext ctx(generationContext::getDefaultContext());
|
||||||
|
ctx.setMaxLineLength(lineLengthLimits::infinite);
|
||||||
|
|
||||||
|
generateImpl(ctx, adapter, 0, NULL);
|
||||||
|
|
||||||
|
return oss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // vmime
|
} // vmime
|
||||||
|
@ -78,6 +78,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool isEmpty() const;
|
bool isEmpty() const;
|
||||||
|
|
||||||
|
/** Returns the email address as a string, by joining components.
|
||||||
|
* (ie. the local name, followed by a @ then the domain name.)
|
||||||
|
*
|
||||||
|
* @return email address as a string
|
||||||
|
*/
|
||||||
|
const string toString() const;
|
||||||
|
|
||||||
// Comparison
|
// Comparison
|
||||||
bool operator==(const class emailAddress& eml) const;
|
bool operator==(const class emailAddress& eml) const;
|
||||||
bool operator!=(const class emailAddress& eml) const;
|
bool operator!=(const class emailAddress& eml) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user