Skip to content

Commit ed4789b

Browse files
committed
latest changes from main rep
1 parent 18dfc99 commit ed4789b

19 files changed

Lines changed: 113 additions & 113 deletions

Net/src/DialogSocket.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DialogSocket.cpp
33
//
4-
// $Id: //poco/Main/Net/src/DialogSocket.cpp#9 $
4+
// $Id: //poco/Main/Net/src/DialogSocket.cpp#10 $
55
//
66
// Library: Net
77
// Package: Sockets
@@ -35,8 +35,8 @@
3535

3636

3737
#include "Poco/Net/DialogSocket.h"
38-
#include <string.h>
39-
#include <ctype.h>
38+
#include <cstring>
39+
#include <cctype>
4040

4141

4242
namespace Poco {
@@ -93,7 +93,7 @@ void DialogSocket::sendByte(unsigned char ch)
9393

9494
void DialogSocket::sendString(const char* str)
9595
{
96-
sendBytes(str, (int) strlen(str));
96+
sendBytes(str, (int) std::strlen(str));
9797
}
9898

9999

@@ -256,7 +256,7 @@ int DialogSocket::receiveStatusLine(std::string& line)
256256
int ch = get();
257257
if (ch != EOF_CHAR) line += (char) ch;
258258
int n = 0;
259-
while (isdigit(ch) && n < 3)
259+
while (std::isdigit(ch) && n < 3)
260260
{
261261
status *= 10;
262262
status += ch - '0';

Net/src/FTPClientSession.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FTPClientSession.cpp
33
//
4-
// $Id: //poco/Main/Net/src/FTPClientSession.cpp#7 $
4+
// $Id: //poco/Main/Net/src/FTPClientSession.cpp#8 $
55
//
66
// Library: Net
77
// Package: FTP
@@ -40,7 +40,7 @@
4040
#include "Poco/Net/ServerSocket.h"
4141
#include "Poco/Net/NetException.h"
4242
#include "Poco/NumberFormatter.h"
43-
#include <ctype.h>
43+
#include <cctype>
4444

4545

4646
using Poco::NumberFormatter;
@@ -459,19 +459,19 @@ void FTPClientSession::parseAddress(const std::string& str, SocketAddress& addr)
459459
while (it != end && *it != '(') ++it;
460460
if (it != end) ++it;
461461
std::string host;
462-
while (it != end && isdigit(*it)) host += *it++;
462+
while (it != end && std::isdigit(*it)) host += *it++;
463463
if (it != end && *it == ',') { host += '.'; ++it; }
464-
while (it != end && isdigit(*it)) host += *it++;
464+
while (it != end && std::isdigit(*it)) host += *it++;
465465
if (it != end && *it == ',') { host += '.'; ++it; }
466-
while (it != end && isdigit(*it)) host += *it++;
466+
while (it != end && std::isdigit(*it)) host += *it++;
467467
if (it != end && *it == ',') { host += '.'; ++it; }
468-
while (it != end && isdigit(*it)) host += *it++;
468+
while (it != end && std::isdigit(*it)) host += *it++;
469469
if (it != end && *it == ',') ++it;
470470
Poco::UInt16 portHi = 0;
471-
while (it != end && isdigit(*it)) { portHi *= 10; portHi += *it++ - '0'; }
471+
while (it != end && std::isdigit(*it)) { portHi *= 10; portHi += *it++ - '0'; }
472472
if (it != end && *it == ',') ++it;
473473
Poco::UInt16 portLo = 0;
474-
while (it != end && isdigit(*it)) { portLo *= 10; portLo += *it++ - '0'; }
474+
while (it != end && std::isdigit(*it)) { portLo *= 10; portLo += *it++ - '0'; }
475475
addr = SocketAddress(host, portHi*256 + portLo);
476476
}
477477

@@ -487,7 +487,7 @@ void FTPClientSession::parseExtAddress(const std::string& str, SocketAddress& ad
487487
if (it != end && *it == delim) ++it;
488488
if (it != end && *it == delim) ++it;
489489
Poco::UInt16 port = 0;
490-
while (it != end && isdigit(*it)) { port *= 10; port += *it++ - '0'; }
490+
while (it != end && std::isdigit(*it)) { port *= 10; port += *it++ - '0'; }
491491
addr = SocketAddress(_controlSocket.peerAddress().host(), port);
492492
}
493493

Net/src/HTMLForm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// HTMLForm.cpp
33
//
4-
// $Id: //poco/Main/Net/src/HTMLForm.cpp#16 $
4+
// $Id: //poco/Main/Net/src/HTMLForm.cpp#17 $
55
//
66
// Library: Net
77
// Package: HTML
@@ -48,7 +48,7 @@
4848
#include "Poco/URI.h"
4949
#include "Poco/String.h"
5050
#include <sstream>
51-
#include <ctype.h>
51+
#include <cctype>
5252

5353

5454
using Poco::NullInputStream;

Net/src/HTTPChunkedStream.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// HTTPChunkedStream.cpp
33
//
4-
// $Id: //poco/Main/Net/src/HTTPChunkedStream.cpp#14 $
4+
// $Id: //poco/Main/Net/src/HTTPChunkedStream.cpp#16 $
55
//
66
// Library: Net
77
// Package: HTTP
@@ -38,7 +38,7 @@
3838
#include "Poco/Net/HTTPSession.h"
3939
#include "Poco/NumberFormatter.h"
4040
#include "Poco/NumberParser.h"
41-
#include <ctype.h>
41+
#include <cctype>
4242

4343

4444
using Poco::NumberFormatter;
@@ -85,9 +85,9 @@ int HTTPChunkedStreamBuf::readFromDevice(char* buffer, std::streamsize length)
8585
if (_chunk == 0)
8686
{
8787
int ch = _session.get();
88-
while (isspace(ch)) ch = _session.get();
88+
while (std::isspace(ch)) ch = _session.get();
8989
std::string chunkLen;
90-
while (isxdigit(ch)) { chunkLen += (char) ch; ch = _session.get(); }
90+
while (std::isxdigit(ch)) { chunkLen += (char) ch; ch = _session.get(); }
9191
while (ch != eof && ch != '\n') ch = _session.get();
9292
unsigned chunk;
9393
if (NumberParser::tryParseHex(chunkLen, chunk))

Net/src/HTTPRequest.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// HTTPRequest.cpp
33
//
4-
// $Id: //poco/Main/Net/src/HTTPRequest.cpp#11 $
4+
// $Id: //poco/Main/Net/src/HTTPRequest.cpp#12 $
55
//
66
// Library: Net
77
// Package: HTTP
@@ -39,7 +39,7 @@
3939
#include "Poco/Net/NetException.h"
4040
#include "Poco/Net/NameValueCollection.h"
4141
#include "Poco/NumberFormatter.h"
42-
#include <ctype.h>
42+
#include <cctype>
4343

4444

4545
using Poco::NumberFormatter;
@@ -174,9 +174,9 @@ void HTTPRequest::getCredentials(std::string& scheme, std::string& authInfo) con
174174
const std::string& auth = get(AUTHORIZATION);
175175
std::string::const_iterator it = auth.begin();
176176
std::string::const_iterator end = auth.end();
177-
while (it != end && isspace(*it)) ++it;
178-
while (it != end && !isspace(*it)) scheme += *it++;
179-
while (it != end && isspace(*it)) ++it;
177+
while (it != end && std::isspace(*it)) ++it;
178+
while (it != end && !std::isspace(*it)) scheme += *it++;
179+
while (it != end && std::isspace(*it)) ++it;
180180
while (it != end) authInfo += *it++;
181181
}
182182
else throw NotAuthenticatedException();
@@ -209,16 +209,16 @@ void HTTPRequest::read(std::istream& istr)
209209
std::string version;
210210
int ch = istr.get();
211211
if (ch == eof) throw NoMessageException();
212-
while (isspace(ch)) ch = istr.get();
212+
while (std::isspace(ch)) ch = istr.get();
213213
if (ch == eof) throw MessageException("No HTTP request header");
214-
while (!isspace(ch) && ch != eof && method.length() < MAX_METHOD_LENGTH) { method += (char) ch; ch = istr.get(); }
215-
if (!isspace(ch)) throw MessageException("HTTP request method invalid or too long");
216-
while (isspace(ch)) ch = istr.get();
217-
while (!isspace(ch) && ch != eof && uri.length() < MAX_URI_LENGTH) { uri += (char) ch; ch = istr.get(); }
218-
if (!isspace(ch)) throw MessageException("HTTP request URI invalid or too long");
219-
while (isspace(ch)) ch = istr.get();
220-
while (!isspace(ch) && ch != eof && version.length() < MAX_VERSION_LENGTH) { version += (char) ch; ch = istr.get(); }
221-
if (!isspace(ch)) throw MessageException("Invalid HTTP version string");
214+
while (!std::isspace(ch) && ch != eof && method.length() < MAX_METHOD_LENGTH) { method += (char) ch; ch = istr.get(); }
215+
if (!std::isspace(ch)) throw MessageException("HTTP request method invalid or too long");
216+
while (std::isspace(ch)) ch = istr.get();
217+
while (!std::isspace(ch) && ch != eof && uri.length() < MAX_URI_LENGTH) { uri += (char) ch; ch = istr.get(); }
218+
if (!std::isspace(ch)) throw MessageException("HTTP request URI invalid or too long");
219+
while (std::isspace(ch)) ch = istr.get();
220+
while (!std::isspace(ch) && ch != eof && version.length() < MAX_VERSION_LENGTH) { version += (char) ch; ch = istr.get(); }
221+
if (!std::isspace(ch)) throw MessageException("Invalid HTTP version string");
222222
while (ch != '\n' && ch != eof) { ch = istr.get(); }
223223
HTTPMessage::read(istr);
224224
ch = istr.get();

Net/src/HTTPResponse.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// HTTPResponse.cpp
33
//
4-
// $Id: //poco/Main/Net/src/HTTPResponse.cpp#11 $
4+
// $Id: //poco/Main/Net/src/HTTPResponse.cpp#12 $
55
//
66
// Library: Net
77
// Package: HTTP
@@ -42,7 +42,7 @@
4242
#include "Poco/DateTimeFormatter.h"
4343
#include "Poco/DateTimeFormat.h"
4444
#include "Poco/DateTimeParser.h"
45-
#include <ctype.h>
45+
#include <cctype>
4646

4747

4848
using Poco::DateTime;
@@ -228,16 +228,16 @@ void HTTPResponse::read(std::istream& istr)
228228

229229
int ch = istr.get();
230230
if (ch == eof) throw NoMessageException();
231-
while (isspace(ch)) ch = istr.get();
231+
while (std::isspace(ch)) ch = istr.get();
232232
if (ch == eof) throw MessageException("No HTTP response header");
233-
while (!isspace(ch) && ch != eof && version.length() < MAX_VERSION_LENGTH) { version += (char) ch; ch = istr.get(); }
234-
if (!isspace(ch)) throw MessageException("Invalid HTTP version string");
235-
while (isspace(ch)) ch = istr.get();
236-
while (!isspace(ch) && ch != eof && status.length() < MAX_STATUS_LENGTH) { status += (char) ch; ch = istr.get(); }
237-
if (!isspace(ch)) throw MessageException("Invalid HTTP status code");
238-
while (isspace(ch)) ch = istr.get();
233+
while (!std::isspace(ch) && ch != eof && version.length() < MAX_VERSION_LENGTH) { version += (char) ch; ch = istr.get(); }
234+
if (!std::isspace(ch)) throw MessageException("Invalid HTTP version string");
235+
while (std::isspace(ch)) ch = istr.get();
236+
while (!std::isspace(ch) && ch != eof && status.length() < MAX_STATUS_LENGTH) { status += (char) ch; ch = istr.get(); }
237+
if (!std::isspace(ch)) throw MessageException("Invalid HTTP status code");
238+
while (std::isspace(ch)) ch = istr.get();
239239
while (ch != '\r' && ch != '\n' && ch != eof && reason.length() < MAX_REASON_LENGTH) { reason += (char) ch; ch = istr.get(); }
240-
if (!isspace(ch)) throw MessageException("HTTP reason string too long");
240+
if (!std::isspace(ch)) throw MessageException("HTTP reason string too long");
241241
if (ch == '\r') ch = istr.get();
242242

243243
HTTPMessage::read(istr);

Net/src/HTTPSession.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// HTTPSession.cpp
33
//
4-
// $Id: //poco/Main/Net/src/HTTPSession.cpp#12 $
4+
// $Id: //poco/Main/Net/src/HTTPSession.cpp#13 $
55
//
66
// Library: Net
77
// Package: HTTP
@@ -37,7 +37,7 @@
3737
#include "Poco/Net/HTTPSession.h"
3838
#include "Poco/Net/HTTPBufferAllocator.h"
3939
#include "Poco/Net/NetException.h"
40-
#include <string.h>
40+
#include <cstring>
4141

4242

4343
using Poco::TimeoutException;
@@ -132,7 +132,7 @@ int HTTPSession::read(char* buffer, std::streamsize length)
132132
{
133133
int n = (int) (_pEnd - _pCurrent);
134134
if (n > length) n = (int) length;
135-
memcpy(buffer, _pCurrent, n);
135+
std::memcpy(buffer, _pCurrent, n);
136136
_pCurrent += n;
137137
return n;
138138
}

Net/src/IPAddress.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// IPAddress.cpp
33
//
4-
// $Id: //poco/Main/Net/src/IPAddress.cpp#15 $
4+
// $Id: //poco/Main/Net/src/IPAddress.cpp#16 $
55
//
66
// Library: Net
77
// Package: NetCore
@@ -40,7 +40,7 @@
4040
#include "Poco/NumberFormatter.h"
4141
#include "Poco/Types.h"
4242
#include <algorithm>
43-
#include <string.h>
43+
#include <cstring>
4444

4545

4646
using Poco::RefCountedObject;
@@ -103,12 +103,12 @@ class IPv4AddressImpl: public IPAddressImpl
103103
public:
104104
IPv4AddressImpl()
105105
{
106-
memset(&_addr, 0, sizeof(_addr));
106+
std::memset(&_addr, 0, sizeof(_addr));
107107
}
108108

109109
IPv4AddressImpl(const void* addr)
110110
{
111-
memcpy(&_addr, addr, sizeof(_addr));
111+
std::memcpy(&_addr, addr, sizeof(_addr));
112112
}
113113

114114
std::string toString() const
@@ -260,12 +260,12 @@ class IPv6AddressImpl: public IPAddressImpl
260260
public:
261261
IPv6AddressImpl()
262262
{
263-
memset(&_addr, 0, sizeof(_addr));
263+
std::memset(&_addr, 0, sizeof(_addr));
264264
}
265265

266266
IPv6AddressImpl(const void* addr)
267267
{
268-
memcpy(&_addr, addr, sizeof(_addr));
268+
std::memcpy(&_addr, addr, sizeof(_addr));
269269
}
270270

271271
std::string toString() const
@@ -426,7 +426,7 @@ class IPv6AddressImpl: public IPAddressImpl
426426
#if defined(_WIN32)
427427
struct addrinfo* pAI;
428428
struct addrinfo hints;
429-
memset(&hints, 0, sizeof(hints));
429+
std::memset(&hints, 0, sizeof(hints));
430430
hints.ai_flags = AI_NUMERICHOST;
431431
int rc = getaddrinfo(addr.c_str(), NULL, &hints, &pAI);
432432
if (rc == 0)
@@ -651,7 +651,7 @@ bool IPAddress::operator == (const IPAddress& a) const
651651
poco_socklen_t l1 = length();
652652
poco_socklen_t l2 = a.length();
653653
if (l1 == l2)
654-
return memcmp(addr(), a.addr(), l1) == 0;
654+
return std::memcmp(addr(), a.addr(), l1) == 0;
655655
else
656656
return false;
657657
}
@@ -662,7 +662,7 @@ bool IPAddress::operator != (const IPAddress& a) const
662662
poco_socklen_t l1 = length();
663663
poco_socklen_t l2 = a.length();
664664
if (l1 == l2)
665-
return memcmp(addr(), a.addr(), l1) != 0;
665+
return std::memcmp(addr(), a.addr(), l1) != 0;
666666
else
667667
return true;
668668
}
@@ -673,7 +673,7 @@ bool IPAddress::operator < (const IPAddress& a) const
673673
poco_socklen_t l1 = length();
674674
poco_socklen_t l2 = a.length();
675675
if (l1 == l2)
676-
return memcmp(addr(), a.addr(), l1) < 0;
676+
return std::memcmp(addr(), a.addr(), l1) < 0;
677677
else
678678
return l1 < l2;
679679
}
@@ -684,7 +684,7 @@ bool IPAddress::operator <= (const IPAddress& a) const
684684
poco_socklen_t l1 = length();
685685
poco_socklen_t l2 = a.length();
686686
if (l1 == l2)
687-
return memcmp(addr(), a.addr(), l1) <= 0;
687+
return std::memcmp(addr(), a.addr(), l1) <= 0;
688688
else
689689
return l1 < l2;
690690
}
@@ -695,7 +695,7 @@ bool IPAddress::operator > (const IPAddress& a) const
695695
poco_socklen_t l1 = length();
696696
poco_socklen_t l2 = a.length();
697697
if (l1 == l2)
698-
return memcmp(addr(), a.addr(), l1) > 0;
698+
return std::memcmp(addr(), a.addr(), l1) > 0;
699699
else
700700
return l1 > l2;
701701
}
@@ -706,7 +706,7 @@ bool IPAddress::operator >= (const IPAddress& a) const
706706
poco_socklen_t l1 = length();
707707
poco_socklen_t l2 = a.length();
708708
if (l1 == l2)
709-
return memcmp(addr(), a.addr(), l1) >= 0;
709+
return std::memcmp(addr(), a.addr(), l1) >= 0;
710710
else
711711
return l1 > l2;
712712
}

Net/src/MailMessage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// MailMessage.cpp
33
//
4-
// $Id: //poco/Main/Net/src/MailMessage.cpp#9 $
4+
// $Id: //poco/Main/Net/src/MailMessage.cpp#10 $
55
//
66
// Library: Net
77
// Package: Mail
@@ -50,7 +50,7 @@
5050
#include "Poco/DateTimeParser.h"
5151
#include "Poco/String.h"
5252
#include <sstream>
53-
#include <ctype.h>
53+
#include <cctype>
5454

5555

5656
using Poco::Base64Encoder;

0 commit comments

Comments
 (0)