aboutsummaryrefslogtreecommitdiffstats
path: root/src/platforms/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/platforms/windows')
-rw-r--r--src/platforms/windows/windowsFile.cpp18
-rw-r--r--src/platforms/windows/windowsHandler.cpp2
-rw-r--r--src/platforms/windows/windowsSocket.cpp20
3 files changed, 23 insertions, 17 deletions
diff --git a/src/platforms/windows/windowsFile.cpp b/src/platforms/windows/windowsFile.cpp
index 8d2a19da..6aa0fea8 100644
--- a/src/platforms/windows/windowsFile.cpp
+++ b/src/platforms/windows/windowsFile.cpp
@@ -61,8 +61,8 @@ const vmime::string windowsFileSystemFactory::pathToString(const vmime::utility:
const vmime::utility::file::path windowsFileSystemFactory::stringToPathImpl(const vmime::string& str)
{
- vmime::string::size_type offset = 0;
- vmime::string::size_type prev = 0;
+ vmime::size_t offset = 0;
+ vmime::size_t prev = 0;
vmime::utility::file::path path;
@@ -117,7 +117,7 @@ bool windowsFileSystemFactory::isValidPathComponent(
}
// Check for invalid characters
- for (string::size_type i = 0 ; i < buffer.length() ; ++i)
+ for (size_t i = 0 ; i < buffer.length() ; ++i)
{
const unsigned char c = buffer[i];
@@ -467,7 +467,7 @@ void windowsFileReaderInputStream::reset()
SetFilePointer(m_hFile, 0, NULL, FILE_BEGIN);
}
-vmime::utility::stream::size_type windowsFileReaderInputStream::read(value_type* const data, const size_type count)
+size_t windowsFileReaderInputStream::read(byte_t* const data, const size_t count)
{
DWORD dwBytesRead;
if (!ReadFile(m_hFile, (LPVOID)data, (DWORD)count, &dwBytesRead, NULL))
@@ -475,24 +475,24 @@ vmime::utility::stream::size_type windowsFileReaderInputStream::read(value_type*
return dwBytesRead;
}
-vmime::utility::stream::size_type windowsFileReaderInputStream::skip(const size_type count)
+size_t windowsFileReaderInputStream::skip(const size_t count)
{
DWORD dwCurPos = SetFilePointer(m_hFile, 0, NULL, FILE_CURRENT);
DWORD dwNewPos = SetFilePointer(m_hFile, (LONG)count, NULL, FILE_CURRENT);
return (dwNewPos - dwCurPos);
}
-vmime::utility::stream::size_type windowsFileReaderInputStream::getPosition() const
+size_t windowsFileReaderInputStream::getPosition() const
{
DWORD dwCurPos = SetFilePointer(m_hFile, 0, NULL, FILE_CURRENT);
if (dwCurPos == INVALID_SET_FILE_POINTER)
windowsFileSystemFactory::reportError(m_path, GetLastError());
- return static_cast <size_type>(dwCurPos);
+ return static_cast <size_t>(dwCurPos);
}
-void windowsFileReaderInputStream::seek(const size_type pos)
+void windowsFileReaderInputStream::seek(const size_t pos)
{
DWORD dwNewPos = SetFilePointer(m_hFile, (LONG)pos, NULL, FILE_BEGIN);
@@ -530,7 +530,7 @@ windowsFileWriterOutputStream::~windowsFileWriterOutputStream()
CloseHandle(m_hFile);
}
-void windowsFileWriterOutputStream::write(const value_type* const data, const size_type count)
+void windowsFileWriterOutputStream::writeImpl(const byte_t* const data, const size_t count)
{
DWORD dwBytesWritten;
if (!WriteFile(m_hFile, data, (DWORD)count, &dwBytesWritten, NULL))
diff --git a/src/platforms/windows/windowsHandler.cpp b/src/platforms/windows/windowsHandler.cpp
index 5b9c37ce..9c96b271 100644
--- a/src/platforms/windows/windowsHandler.cpp
+++ b/src/platforms/windows/windowsHandler.cpp
@@ -206,7 +206,7 @@ static inline bool isFQDN(const vmime::string& str)
if (utility::stringUtils::isStringEqualNoCase(str, "localhost", 9))
return false;
- const vmime::string::size_type p = str.find_first_of(".");
+ const vmime::size_t p = str.find_first_of(".");
return p != vmime::string::npos && p > 0 && p != str.length() - 1;
}
diff --git a/src/platforms/windows/windowsSocket.cpp b/src/platforms/windows/windowsSocket.cpp
index 502d1067..2cad21c0 100644
--- a/src/platforms/windows/windowsSocket.cpp
+++ b/src/platforms/windows/windowsSocket.cpp
@@ -230,7 +230,7 @@ const string windowsSocket::getPeerName() const
}
-windowsSocket::size_type windowsSocket::getBlockSize() const
+size_t windowsSocket::getBlockSize() const
{
return 16384; // 16 KB
}
@@ -238,12 +238,12 @@ windowsSocket::size_type windowsSocket::getBlockSize() const
void windowsSocket::receive(vmime::string& buffer)
{
- const size_type size = receiveRaw(m_buffer, sizeof(m_buffer));
+ const size_t size = receiveRaw(m_buffer, sizeof(m_buffer));
buffer = vmime::string(m_buffer, size);
}
-windowsSocket::size_type windowsSocket::receiveRaw(char* buffer, const size_type count)
+size_t windowsSocket::receiveRaw(char* buffer, const size_t count)
{
m_status &= ~STATUS_WOULDBLOCK;
@@ -307,15 +307,21 @@ windowsSocket::size_type windowsSocket::receiveRaw(char* buffer, const size_type
void windowsSocket::send(const vmime::string& buffer)
{
- sendRaw(buffer.data(), buffer.length());
+ sendRaw(reinterpret_cast <const byte_t*>(buffer.data()), buffer.length());
}
-void windowsSocket::sendRaw(const char* buffer, const size_type count)
+void windowsSocket::send(const char* str)
+{
+ sendRaw(reinterpret_cast <const byte_t*>(str), strlen(str));
+}
+
+
+void windowsSocket::sendRaw(const char* buffer, const size_t count)
{
m_status &= ~STATUS_WOULDBLOCK;
- size_type size = count;
+ size_t size = count;
while (size > 0)
{
@@ -344,7 +350,7 @@ void windowsSocket::sendRaw(const char* buffer, const size_type count)
}
-windowsSocket::size_type windowsSocket::sendRawNonBlocking(const char* buffer, const size_type count)
+size_t windowsSocket::sendRawNonBlocking(const char* buffer, const size_t count)
{
m_status &= ~STATUS_WOULDBLOCK;