本文整理汇总了C++中DString::split方法的典型用法代码示例。如果您正苦于以下问题:C++ DString::split方法的具体用法?C++ DString::split怎么用?C++ DString::split使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DString
的用法示例。
在下文中一共展示了DString::split方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: html_test
void TestDSMTP::html_test()
{
DSMTP mail;
DSMTP::ERRNO code;
DURL server;
DStringList transaction, charlist;
DStringList::const_iterator it;
int i = 2;
server.setURL( "smtp://localhost.localdomain:25" );
mail.setHost ( server );
mail.setSender ( "[email protected]" );
mail.addReceiver ( "[email protected]" );
DString buffer = "This is just a simple DLibs test, SMTP part\n\n";
buffer += utf8chars;
charlist = utf8chars.split( " " );
DString html = "<!DOCTYPE html>\n<html>\n<body>\n<h1>This is just a simple DLibs test, SMTP part</h1>\n";
html += "<table>\n";
html += "<tr>\n";
for ( it = charlist.begin() ; it != charlist.end() ; ++it )
{
if ( ! ( i % 16 ) )
{
html += "</tr>\n";
html += "<tr>\n";
}
html += "<td>";
html += it->toHTML();
html += "</td>\n";
i++;
}
html += "</tr>\n";
html += "</table>\n";
html += "</body>\n</html>";
mail.setEmail ( "DLibs test", buffer, html );
code = mail.send();
TEST_ASSERT_MSG( mail.getLastError() == DString::empty(), "Error reported when sending email" )
TEST_ASSERT_MSG( code == DSMTP::SUCCESS, "Email not sent" )
transaction = mail.getTransactionLog();
for ( it = transaction.begin() ; it != transaction.end() ; it++ )
{
std::cout << *it << std::endl;
}
}