double-conversion floating-point conversions

- using double-conversion library for floating-point numeric/string
conversions
- added string replace[InPlace], remove[InPlace]
- reverted overwritten FileChannel purge age and count features
- file size value checks in SMTPClient
This commit is contained in:
aleks-f
2012-12-01 14:02:51 -06:00
parent 9dd1482a02
commit 134558f926
13 changed files with 372 additions and 293 deletions

View File

@@ -138,11 +138,19 @@ void SMTPChannel::log(const Message& msg)
Poco::FileInputStream fis(_attachment, std::ios::in | std::ios::binary | std::ios::ate);
if (fis.good())
{
int size = fis.tellg();
char* pMem = new char [size];
typedef std::allocator<std::string::value_type>::size_type SST;
std::streamoff size = fis.tellg();
poco_assert (std::numeric_limits<unsigned int>::max() >= size);
poco_assert (std::numeric_limits<SST>::max() >= size);
char* pMem = new char [static_cast<unsigned int>(size)];
fis.seekg(std::ios::beg);
fis.read(pMem, size);
message.addAttachment(_attachment, new StringPartSource(std::string(pMem, size), _type, _attachment));
message.addAttachment(_attachment,
new StringPartSource(std::string(pMem, static_cast<SST>(size)),
_type,
_attachment));
delete [] pMem;
}
}